{ "name": "Automated Testing and Debugging", "order": 14, "time": "15m", "challenges": [ { "id":"cf1111c1c16feddfaeb6bdef", "title":"Use the Javascript Console", "difficulty":0, "description":[ "Both Chrome and Firefox have excellent JavaScript consoles, also known as DevTools, for debugging your JavaScript.", "You can find Developer tools in your Chrome's menu or Web Console in FireFox's menu. If you're using a different browser, or a mobile phone, we strongly recommend switching to desktop Firefox or Chrome.", "Let's print to this console using the console.log method.", "console.log('Hello world!')" ], "tests":[ "assert(editor.getValue().match(/console\\.log\\(/gi), 'message: You should use the console.log method to log \"Hello world!\" to your JavaScript console.');" ], "challengeSeed":[ "", "", "" ], "challengeType":1, "type": "waypoint" }, { "id":"cf1111c1c16feddfaeb7bdef", "title":"Using typeof", "difficulty":0, "description":[ "You can use typeof to check the data structure, or type, of a variable.", "Note that in JavaScript, arrays are technically a type of object.", "Try using typeof on each of the following to see which types they have.", "console.log(typeof(\"\"));", "console.log(typeof(0));", "console.log(typeof([]));", "console.log(typeof({}));" ], "tests":[ "assert(editor.getValue().match(/console\\.log\\(typeof\\(\"\"\\)\\);/gi), 'message: You should console.log the typeof a string.');", "assert(editor.getValue().match(/console\\.log\\(typeof\\(0\\)\\);/gi), 'message: You should console.log the typeof a number.');", "assert(editor.getValue().match(/console\\.log\\(typeof\\(\\[\\]\\)\\);/gi), 'message: You should console.log the typeof an array.');", "assert(editor.getValue().match(/console\\.log\\(typeof\\(\\{\\}\\)\\);/gi), 'message: You should console.log the typeof a object.');" ], "challengeSeed":[ "", "", "" ], "challengeType":1, "type": "waypoint" } ] }