Skip to content
Advertisement

assign multiple const to the same value in Javascript

Is something like this possible? I have tried using let with no success after some research.

JavaScript

or

JavaScript

Advertisement

Answer

The thing on the right has to match the destructuring thing on the left, in your case the thing on the left is looking for an array with at least four elements, so:

JavaScript

or, make a temporary array and use its map method to produce the array of divs

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement