gpt4 book ai didi

javascript - 意外 token : using map to form array of object

转载 作者:搜寻专家 更新时间:2023-11-01 05:03:38 26 4
gpt4 key购买 nike

<分区>

我要制作这个

[
{name: "james", age: 10},
{name: "john", age: 12},
{name: "johnny", age: 56}
]

我的以下代码失败了,得到了预期的 token ?

let x = [
{name: "james", age: 10, school: "London"},
{name: "john", age: 12, school: "India"},
{name: "johnny", age: 56, school: "USA"}
]

let y = x.map(obj => {name:obj.name, age:obj.age})

console.log(y)

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com