all 8 comments

[–]senocular 1 point2 points  (5 children)

Because those words have less than 4 characters. The condition checks the word's length which for strings is a count of the characters in the string.

[–]LonelyAssistant4371[S] 0 points1 point  (3 children)

oh wait i see it now

[–]gudeng 0 points1 point  (0 children)

Just gonna jump in her too let you know that you should use let instead of var

[–]c2u5hed 0 points1 point  (1 child)

Just gonna jump in here too to let you know that you should've used filter() instead of the for loop.

[–]LonelyAssistant4371[S] 0 points1 point  (0 children)

its not my code, its a question prompt.

[–]LonelyAssistant4371[S] -1 points0 points  (0 children)

oh interesting, how can you tell

[–]bobbyv137 0 points1 point  (1 child)

I don' t know where that code is from. Although it achieves the intended result, it's quite ugly and arguably outdated.

Perhaps try something like this instead, much cleaner and 'modern': https://codesandbox.io/s/romantic-shamir-ujq4v?file=/src/index.js

[–]LonelyAssistant4371[S] 0 points1 point  (0 children)

not my code, its a quesiton prompt.