if u r familiar with Javascript can u tell what will be the output of these lines ?

var src="abcd";
var dest="";
for (var i=0;i<4;i++)
{
          dest+=src[i];
}
alert(dest);

well, it’s obvious that this fragment will produce a message box holding the string “abcd” unless u r used to code Javascript for IE

in Firefox or Chrome it works like a charm

More

Advertisements