51 lines
1.9 KiB
JSON
51 lines
1.9 KiB
JSON
{
|
|
"name": "Automated Testing and Debugging - Coming Soon",
|
|
"order": 0.012,
|
|
"challenges": [
|
|
{
|
|
"id":"cf1111c1c16feddfaeb6bdef",
|
|
"title":"Using the Javascript console",
|
|
"difficulty":0,
|
|
"description":[
|
|
"",
|
|
"The browser console is the best and easiest tool for debugging your scripts",
|
|
"It can normally be access by pressing f12 in most browsers or right click > inspect element > console",
|
|
"Let's print to this console using the console.log method",
|
|
"<code>console.log('Hello world!')</code>"
|
|
],
|
|
"tests":[
|
|
"assert(editor.getValue().match(/console\\.log\\(/gi), 'You should use the console.log method to ');"
|
|
],
|
|
"challengeSeed":[
|
|
""
|
|
],
|
|
"challengeType":1
|
|
},
|
|
{
|
|
"id":"cf1111c1c16feddfaeb7bdef",
|
|
"title":"Using typeof",
|
|
"difficulty":0,
|
|
"description":[
|
|
"",
|
|
"typeof is a useful method that we can use to check the type of a variable",
|
|
"One thing to be careful of is that an array has the type objects",
|
|
"Try using each of these to see the types they have",
|
|
"<code>console.log(typeof(\"\"));",
|
|
"console.log(typeof(0));",
|
|
"console.log(typeof([]));",
|
|
"console.log(typeof({}));</code>"
|
|
],
|
|
"tests":[
|
|
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\"\"\\)\\);/gi), 'You should console.log the typeof a string');",
|
|
"assert(editor.getValue().match(/console\\.log\\(typeof\\(0\\)\\);/gi), 'You should console.log the typeof a number');",
|
|
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\[\\]\\)\\);/gi), 'You should console.log the typeof a array');",
|
|
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\{\\}\\)\\);/gi), 'You should console.log the typeof a object');"
|
|
],
|
|
"challengeSeed":[
|
|
""
|
|
],
|
|
"challengeType":1
|
|
}
|
|
]
|
|
}
|