Why does it print out [ ]?


I know this code is right... but why is it printing out the [ ]????

var junk = ["Worn clothes","Box",1351,211]; {


its printing the [] because you are printing junk which is of type list. Now the that's the string representation of list. To print it without the [] we have to do


but you need to sanitize your code in to this

var junk = ["Worn clothes","Box",1351,211];


Exactly what is his code doing right now? I would have to assume there would be an error for the " { } " But I don't really understand how that's working.


His code as he has put it will print this

[ 'Worn clothes', 'Box', 1351, 211 ]

but he doesn't want the [] in there.
With the way he has defined it if the data was large enough he could loose some data because the parser could halt


coz you are trying to pint out an array ...it wont work .. you have to use loop

like this :smile:
var junk = ["Worn clothes","Box",1351,211];
var i =0;
for(i=0;i< junk.length;i++){