Exercise 5.7

This commit is contained in:
Karan
2021-11-24 19:39:54 +05:30
committed by GitHub
parent 3be0773888
commit 8692cecb8c
+16
View File
@@ -0,0 +1,16 @@
const obj = {
a: 1,
b: 2,
c: 3
};
for (let prop in obj) {
console.log(prop, obj[prop]);
}
const arr = ["a", "b", "c"];
for (let w = 0; w < arr.length; w++) {
console.log(w, arr[w]);
}
for (el in arr) {
console.log(el, arr[el]);
}