Post History
JavaScript, 25 bytes Input as an array of digits a=>a.map(x=>t+=x%2,t=0)|t Try it online! 26 bytes With input as a string (or an array of digit strings). f=([d,...a])=>d?d%2+f(a):0...
Answer
#2: Post edited
- # JavaScript, 25 bytes
- Input as an array of digits
- a=>a.map(x=>t+=x%2,t=0)|t
[Try it online!](https://tio.run/##y0osSyxOLsosKNEts/ifZvs/0dYuUS83sUCjwtauRNu2QtVIp8TWQLOm5H9BUWZeiUaaRrShjpGOsY6JjqmOmY65joWOZaym5n8A)
- # JavaScript, 25 bytes
- Input as an array of digits
- a=>a.map(x=>t+=x%2,t=0)|t
- [Try it online!](https://tio.run/##y0osSyxOLsosKNEts/ifZvs/0dYuUS83sUCjwtauRNu2QtVIp8TWQLOm5H9BUWZeiUaaRrShjpGOsY6JjqmOmY65joWOZaym5n8A)
- ## 26 bytes
- With input as a string (or an array of digit strings).
- f=([d,...a])=>d?d%2+f(a):0
- [Try it online!](https://tio.run/##y0osSyxOLsosKNEts/j/P81WIzpFR09PLzFW09YuxT5F1Ug7TSNR08rgf0FRZl6JRppGgqGRsYmpmbmFZYKm5n8A)