Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(first, second) {
- let third = [];
- for(let i = 0; i < first.length; i++) {
- if (i % 2 === 1) {
- third.push((first[i] + second[i]).toString());
- } else {
- third.push(Number(first[i]) + Number(second[i]));
- }
- }
- console.log(third.join(" - "));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement