Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Sort an array using setTimeout function

let arr = [10, 100, 500, 20, 35];

arr.forEach(item => {
    setTimeout(() => console.log(item), item);
})
 
PREVIOUS NEXT
Tagged: #Sort #array #setTimeout #function
ADD COMMENT
Topic
Name
8+2 =