Does anyone know what this code does? It is written in Javascript.
var RocknCoder = RocknCoder || {};
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.
Short for:
{}is an object initializer. Try verbalizing it and it makes more sense:I believe that using the short form is better than the
ifsimply because it blocks aReferenceErrorfrom occurring on theifcondition if the variable is not already declared in scope.varon the declaration may obviate that with hoisting, though.