Closed
Description
I'm in a situation where I'm trying to make an array of random x y coordinates but the underscore in the map function is being flagged as an unused var. I'm not sure if there is a better way to write this or if I should simply do an inline ignore in this case.
In short: how do I avoid the no-unused-vars
error when I don't need the currentValue
required by the Array.map()
method?
const getRandomInt = max => Math.floor(Math.random() * Math.floor(max));
const myCoolArray = new Array(25)
.fill({})
.map(_ => ({
x: getRandomInt(100),
y: getRandomInt(100)
}))