In jQuery core.js, currently, line 260
this.slice( i, +i + 1 );
is the “+i” statement a mistake or some fancy trickery I can’t find any mention of?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a quick way to convert
ito a number. This matters because+means something different if it is a string to if it is a number. For instance:It’s basically a shortcut for
parseInt(i, 10).