1.2 KiB
1.2 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7b87367417b2b2512b43 | Use Arrow Functions to Write Concise Anonymous Functions | 1 |
Description
undefined
Instructions
undefined
Tests
tests:
- text: ''
testString: 'getUserInput => assert(!getUserInput("index").match(/var/g), "User did replace <code>var</code> keyword.");'
- text: ''
testString: 'getUserInput => assert(getUserInput("index").match(/const\s+magic/g), "<code>magic</code> should be a constant variable (by using <code>const</code>).");'
- text: ''
testString: 'assert(typeof magic === "function", "<code>magic</code> is a <code>function</code>.");'
- text: ''
testString: 'assert(magic().getDate() == new Date().getDate(), "<code>magic()</code> returns correct date.");'
- text: ''
testString: 'getUserInput => assert(!getUserInput("index").match(/function/g), "<code>function</code> keyword was not used.");'
Challenge Seed
var magic = function() {
"use strict";
return new Date();
};
Solution
// solution required