-4

function findEfficientBulbs(serialNumbers) { console.log(serialNumbers);

    const efficientSerialNumbers = []
    // Write your code here

    for (let i = 0; i < serialNumbers.length; i++){
        const iNumber = serialNumbers[i]
        if (iNumber.length === 6 && iNumber % 2 !== 0){
            efficientSerialNumbers.push(serialNumbers[i])
        
        }
    } 
   return efficientSerialNumbers; 
}
  • 2
    Looks like it is javascript. Why than the java tag? Java is very different to javascript – Jens Aug 31 '23 at 14:10
  • 1
    Do you a question more specific than "will you do my homework for me"? – Gary Aug 31 '23 at 14:28
  • Welcome ! Please [read the tour](https://stackoverflow.com/tour) first. Also see [how to ask/answer homework questions](https://meta.stackoverflow.com/questions/334822/how-do-i-ask-and-answer-homework-questions) – Peter Krebs Aug 31 '23 at 15:05
  • HI Lads, I got this result: 4 Passing 1 Failing should return an array ✓ Well done! logs [ 123123 ] should discard serial numbers with five or fewer figures ✓ Well done! logs [ 1, 123, 12345 ] should discard serial numbers with seven or more figures ✓ Well done! logs [ 1234567, 123456789 ] should discard even numbers ✓ Well done! should keep all efficient numbers - those that are odd and have six digits in ✕ AssertionError: expected [] to deeply equal [ 234567, 456789 ] – Shahrad Zare Sep 01 '23 at 09:18

0 Answers0