by Nathan
반복문 4가지
1. for .. in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Initialize object. a = {"a" : "Athens" , "b" : "Belgrade", "c" : "Cairo"} // Iterate over the properties. var s = "" for (var key in a) { s += key + ": " + a[key]; s += " "; } document.write (s); // Output: // a: Athens // b: Belgrade // c: Cairo Colored by Color Scripter cs 2. for 1 2 3 4 5 var array = ['A', 'B', 'C', 'D']; for(var i=0; i
Programming/JavaScript, Json
2017. 3. 17. 10:31