DEV Community

Discussion on: JS Test #4: try/catch

Collapse
 
petermoyano profile image
Pedro Ignacio Moyano

Won't e1.message.split("")[0] give you the first letter of Cannot ? So the expression actually evaluates C === C. Great series though, it's really helpfull for us begginers. Thank you Coderslang.

Collapse
 
darrylnoakes profile image
Darryl Noakes

It's splitting on " ", not "", so it will split on spaces, not every character. That means the first element will be the word "Cannot".