for in
遍历对象的属性
for(let item in obj){ str += `<tr> <td>${obj[item].name}</td> <td>${obj[item].age}</td> <td>${obj[item].gender}</td> <td><input type="button" data-id="${obj[item].id}" name="update" value="修改"/><input type="button" value="删除" data-id="${obj[item].id}" name="delete"/></td> </tr>`; }
for of
遍历对象( Array, Map, Set, String, TypedArray,arguments 等等)的属性值,但对普通对象不支持