Skip to main content
Post Undeleted by ABGR
edited body
Source Link
ABGR
  • 5.3k
  • 4
  • 34
  • 56

I think you're looking for this. You can use map when you want to return a new array. If you just want to iterate your should use forEach.

let array = new Array(4560).fill(1); const map1 = array.mapforEach(x => console.log("x"x)); console.log(map1)

I think you're looking for this

let array = new Array(45); const map1 = array.map(x => console.log("x")); console.log(map1)

I think you're looking for this. You can use map when you want to return a new array. If you just want to iterate your should use forEach.

let array = new Array(60).fill(1); array.forEach(x => console.log(x));

Post Deleted by ABGR
Source Link
ABGR
  • 5.3k
  • 4
  • 34
  • 56

I think you're looking for this

let array = new Array(45); const map1 = array.map(x => console.log("x")); console.log(map1)