Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(arr) {
- const result = [];
- for (let num of arr) {
- if (num < 0) {
- result.unshift(num);
- } else {
- result.push(num);
- }
- for (let num of result) {
- }
- }
- console.log(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement