📜  干净的代码 javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:22.909000             🧑  作者: Mango

代码示例1
//Not clean code 
const array = ["Fahad", "Khan", "Babar"];
for(let i=0; i < array.length; i++){
    console.log(array[i]);
}

//Clean code 
const array = ["Fahad", "Khan", "Babar"];
array.forEach((item,index) => console.log(index, item))