Skip to content

Sysetup/module-random-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Module: Random array.


   ____             __             
  / __/_ _____ ___ / /___ _____ _/|
 _\ \/ // (_-</ -_) __/ // / _ > _<
/___/\_, /___/\__/\__/\_,_/ .__//  
    /___/                /_/       
> Systems development company.

This script shuffles the elements of an array.

Instructions:

let arr = [1,3,4,7]
randomArray(arr)
console.log(arr)

Examples:

Front-end:

  1. Inside the html file:
<script type="module" src="index.js"></script>
<script type="module" src="main.js"></script>
  1. Inside the main.js file:
let arr = [1,3,4,7]
let i = 0
randomArray(arr)
while (i < arr.lenght) {
    console.log(arr[i])
    i++
}

Back-end:

  1. Inside the main.js file:
import randomArray from "./module-random-array/index.js";
let arr = [1,3,4,7]
randomArray(arr)

About

This script shuffles the elements of an array.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors