用js刷题的时候,使用for…in遍历一个数组,结果输出的是它的索引?
for...in 遍历的是“键”(Key/Index) for...of 遍历的是“值”(Value)
- for…in:也就是 “Index”,主要用于对象(Object)的属性遍历。
- for…of:也就是 “Object Value”,主要用于数组(Array)或可迭代对象的元素遍历。
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true