几天前我开始学习p5.js,现在我想使用IntelliJ IDEA代替p5.js online editor。 const array1 =[{"id": 1,"value": false},{"id": 2,{"id": 3,"value": true},{"id": 4,"value": false}]
const array2 = [{"id": 1},{"id": 4}]
const result = array1.map(({id,value}) => ({
id,value: value || array2.some(item => item.id === id)
}))
console.log(result)
,setup()
和draw()
函数之类的大多数东西都可以正常工作,但是ellipse()
函数却无法正常工作-它带有绿色下划线,并且错误消息显示“未解决的函数或方法createCanvas()”。
我尝试使用VSCode,并且在那里运行良好,但是我更喜欢使用IntelliJ,所以我想知道是否(如果可以)如何使它在IntelliJ中工作。
createCanvas()
<script src="p5.js"></script> //p5.js is the file with all the code from the official p5js.org homepage.
<script src="sketch.js"></script> //sketch.js is the file where my code that should be executed is located