While Loop Through Array Javascript Append Function In C