Can you shuffle an array? | JavaScript Interview Question
@Yomesh Gupta

JavaScriptAll Levels
491
Do you see value in our efforts?

Devtools Tech is a free platform for Frontend Engineers. It takes a lot of time, effort, and finanical resources to keep the platform running. If you see any value in our work and would like to support us then you can do using the following options.

InternationalDomestic

Given an array, write a function that should modify the array inline to generate a randomly picked permutation of the original array.

const arr = [1,2,3,4];

shuffle(arr);
console.print(arr);
// [4,2,3,1]

shuffle(arr);
console.print(arr);
// [2,3,1,4]

Loading IDE...