Which is a more efficient JavaScript code snippet? Code 1 : // for loop in javascript for(var num=10;num>=1;num--) { document.writeln(num); } Code 2 : var num=10; while(num>=1) { document.writeln(num); num++; }

Question:Which is a more efficient JavaScript code snippet? Code 1 : // for loop in javascript for(var num=10;num>=1;num--) { document.writeln(num); } Code 2 : var num=10; while(num>=1) { document.writeln(num); num++; }

1.Code 1

2.Code 2

3.Both Code 1 and Code 2

4.Cannot Compare


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!