请查阅博客 https://blog.csdn.net/aerchi/article/details/80221274 一句话概括就是for...in...可以用于遍历对象的各个属性,但是for...of...只能遍历数组