我试图通过这些数组的循环,但得到这个错误"传统八进制文字是不允许在严格模式">
const myList =[
{
id: 01,
title: 'FrontEnd Engineer',
name : 'Sheshathri',
describtion: "simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book"
},
{
id: 02,
title: 'QA Engineer',
name : 'Jobin',
describtion: "It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
}
]
export default myList;
在App.js
import myList from './ContentList';
const listItem = myList.map(list => <Content key= {list.id} title = {list.title} name = {list.name} describtion = {list.describtion} />);
我试图通过这些数组的循环,但我得到这个错误严格模式下不允许遗留八进制文字">
指的是你的id:
id: 01,
title: 'FrontEnd Engineer',
替换为
id: 1,
title: 'FrontEnd Engineer',
八进制系统八进制字面值是以前导零开始的数字,例如:
var num = 071;//57
用于标识八进制文字的前导零是的来源JavaScript中的混乱和错误。ECMAScript 5不赞成使用八进制数字字面值在JavaScript和八进制字面值导致语法