Answers for "create array from names no duplicates javascript"

1

javascript create array with repeated values

Array(5).fill(2)
//=> [2, 2, 2, 2, 2]
Posted by: Guest on February-17-2021
0

sort javascript number array with duplicates

//ascending order
console.log([1, 2, 0, 1].sort((a, b) => a - b))

//descending order
console.log([1, 2, 0, 1].sort((a, b) => b - a))
 Run code snippetHide results
Posted by: Guest on February-25-2022

Code answers related to "create array from names no duplicates javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language