Print instead of console.log (js)

Doing the shortest code challenges I see some people using print, instead of console.log, because its shorter
Ive tried it, and it strikes-through when I type it, I guess that is because it is not a valid JS command.
So my question is why does it work, if print not a command word?

1 Like

print is actually a deprecated function in JS here, which means it is planned to be discontinued in the future versions of JS. However, deprecation of a function only indicates that it shall be avoided for maintaining a compatible program across its coming versions, and is still defined for the purposes like backward compatibility that means here that any earlier code using print shall not get an error with this present JS engine.
Good observation, and nicely questioned. Hoping it helps.