Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wrongResult = (...nums) => {
- const isNegativeMultiply = (nums) => {
- let negativeCount = 0;
- for(let num of nums) {
- if(num === 0) {
- return false;
- } else if(num < 0) {
- negativeCount++;
- }
- }
- return negativeCount % 2 === 1;
- };
- console.log( isNegativeMultiply(nums) ? 'Negative' : 'Positive' );
- };
Advertisement
Add Comment
Please, Sign In to add comment