* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2.3 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
56533eb9ac21ba0edf2244ab | Understanding Case Sensitivity in Variables | 1 | https://scrimba.com/c/cd6GDcD | 18334 | understanding-case-sensitivity-in-variables |
--description--
In JavaScript all variables and function names are case sensitive. This means that capitalization matters.
MYVAR
is not the same as MyVar
nor myvar
. It is possible to have multiple distinct variables with the same name but different casing. It is strongly recommended that for the sake of clarity, you do not use this language feature.
Best Practice
Write variable names in JavaScript in camelCase. In camelCase, multi-word variable names have the first word in lowercase and the first letter of each subsequent word is capitalized.
Examples:
var someVariable;
var anotherVariableName;
var thisVariableNameIsSoLong;
--instructions--
Modify the existing declarations and assignments so their names use camelCase.
Do not create any new variables.
--hints--
studlyCapVar
should be defined and have a value of 10
.
assert(typeof studlyCapVar !== 'undefined' && studlyCapVar === 10);
properCamelCase
should be defined and have a value of "A String"
.
assert(
typeof properCamelCase !== 'undefined' && properCamelCase === 'A String'
);
titleCaseOver
should be defined and have a value of 9000
.
assert(typeof titleCaseOver !== 'undefined' && titleCaseOver === 9000);
studlyCapVar
should use camelCase in both declaration and assignment sections.
assert(code.match(/studlyCapVar/g).length === 2);
properCamelCase
should use camelCase in both declaration and assignment sections.
assert(code.match(/properCamelCase/g).length === 2);
titleCaseOver
should use camelCase in both declaration and assignment sections.
assert(code.match(/titleCaseOver/g).length === 2);
--seed--
--seed-contents--
// Variable declarations
var StUdLyCapVaR;
var properCamelCase;
var TitleCaseOver;
// Variable assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;
--solutions--
var studlyCapVar;
var properCamelCase;
var titleCaseOver;
studlyCapVar = 10;
properCamelCase = "A String";
titleCaseOver = 9000;