{ "name": "Automated Testing and Debugging", "order": 20, "time": "15 minutes", "helpRoom": "HelpBackEnd", "challenges": [ { "id": "cf1111c1c16feddfaeb6bdef", "title": "Use the JavaScript Console", "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!')" ], "challengeSeed": [ "", "", "" ], "solutions": [ "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.');" ], "type": "waypoint", "challengeType": 1, "titleEs": "Utiliza la consola de JavaScript", "descriptionEs": [ "Tanto Chrome como Firefox tienen excelentes consolas JavaScript, también conocidas como DevTools, para depurar tu código JavaScript.", "Puedes encontrar las Herramientas para desarrolladores (Developer tools) en el menú de Chrome o la Consola web (Web Console) en el menú de FireFox. Si estás utilizando un navegador diferente, o un dispositivo móvil, nuestra recomendación es que cambies a la versión de escritorio de Firefox o Chrome.", "Vamos a imprimir en esta consola utilizando el método console.log.", "console.log('Hello world!')" ] }, { "id": "cf1111c1c16feddfaeb7bdef", "title": "Using typeof", "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 {});" ], "challengeSeed": [ "", "", "" ], "solutions": [ "console.log(typeof \"\");\nconsole.log(typeof 0);\nconsole.log(typeof []);\nconsole.log(typeof {});" ], "tests": [ "assert(code.match(/console\\.log\\(typeof[\\( ][\"'].*[\"']\\)?\\);/), 'message: You should console.log the typeof a string.');", "assert(code.match(/console\\.log\\(typeof[\\( ]\\d+\\.?\\d*\\)?\\);/), 'message: You should console.log the typeof a number.');", "assert(code.match(/console\\.log\\(typeof[\\( ]\\[\\]\\)?\\);/), 'message: You should console.log the typeof an array.');", "assert(code.match(/console\\.log\\(typeof[\\( ]\\{\\}\\)?\\);/), 'message: You should console.log the typeof an object.');" ], "type": "waypoint", "challengeType": 1, "titleEs": "Usando typeof", "descriptionEs": [ "Puedes usar typeof para verificar la estructura de datos, o el tipo, de una variable.", "Ten en cuenta que, en JavaScript, los vectores son técnicamente un tipo de objeto.", "Intenta utilizar typeof en cada uno de los siguientes valores para ver de qué tipo son.", "console.log(typeof(\"\"));", "console.log(typeof(0));", "console.log(typeof([]));", "console.log(typeof({}));" ] } ] }