Guest User

Untitled

a guest
Dec 13th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function shuffle(array) {
  2. var currentIndex = array.length, temporaryValue, randomIndex;
  3.  
  4. // While there remain elements to shuffle...
  5. while (0 !== currentIndex) {
  6.  
  7. // Pick a remaining element...
  8. randomIndex = Math.floor(Math.random() * currentIndex);
  9. currentIndex -= 1;
  10.  
  11. // And swap it with the current element.
  12. temporaryValue = array[currentIndex];
  13. array[currentIndex] = array[randomIndex];
  14. array[randomIndex] = temporaryValue;
  15. }
  16.  
  17. return array;
  18. }
  19. let lista = '';
  20. function mezclar(valor){
  21. lista += `${valor} \n`;
  22. }
  23.  
  24. let poema_producto = lista.split('\n');
  25.  
  26. console.log(poema_producto);
Add Comment
Please, Sign In to add comment