Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x = prompt('Podaj 1 liczbę') ;
- var y = prompt('Podaj 2 liczbę') ;
- var z = prompt('Podaj 3 liczbę') ;
- numericStringArray = new Array(x, y, z)
- function compareNumbers(a, b) {
- return a + b
- }
- console.log(" <b>Wpisane liczby:</b> " + '<u>'+numericStringArray.join()+'</u><p>')
- console.log(" Liczby posortowane rosnąco: " + '<u>'+numericStringArray.sort()+'</u><p>')
- console.log(" Liczby posortowane malejąco: " + '<u>'+ numericStringArray.sort(compareNumbers)+'</u><p>')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement