C Update Array Length Function In Js