html
html
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
https://www.sololearn.com/Discuss/3004001/?ref=app
How can randomize or shuffle data in JavaScript?
Hi there,
I want to randomize or shuffle the list of movie names and always want to come up with completely unique movie names.
For example, this is my list of movie names:
1. The Shawshank Redemption
2. The Godfather
3. Fight Club
4. Inception
5. Goodfellas
6. Seven Samurai
7. The Matrix
@param {array} movies Array of movie list
@return {string} a movie title
*/
function getRandomMovies(movies) {
const length = movies.length;
const index = Math.floor(Math.random()*length);
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run