Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function negativeOrPositiveNumbers(arr) {
- let result = [];
- for (let i = 0; i < arr.length; i++){
- arr[i] < 0 ? result.unshift(arr[i]) : result.push(arr[i]);
- }
- console.log(result.join('\n'));
- }
Add Comment
Please, Sign In to add comment