Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

for in for of

//for of for the array values and in for properties of  obj and array indexes


const person = ['a' , 'b' , 'c'];
for (let x in person) {
 document.write([x]);
}
const person = ['a' , 'b' , 'c'];

for (let x in person) {
 document.write(person[x]);
}
for (let x of person) {
 document.write([x]);
}



Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+4 =