my first question here! Apologies if a duplicate - couldn't find an answer.
I'm a beginner in JavaScript, currently doing some exercises and I've just ran across a line I can't grasp the meaning of. Here it is:
!+x && x !== '0'
What does !+x perform here? Line's an excerpt from a script that validates IP adresses.
Thank you in advance!
+makes it a number if possible,!negates its truthy or falsy value. Basically it’s an attempt to check ifxis a number.