Type cohersion and type juggling can bring a few surprises. But usually only when you do something weird to hit those edge cases. Otherwise, it's standard library is actually very decent now. Especially when working with arrays. You have all the nice to have methods, like, split, find, filter, map, reduce, every, some, etc... Which makes it a really nice language for these kind of tasks.
The example above would like this in modern javascript:
str.split(',').map(char => Number(char)).filter(num => num > 5).length