--- id: 646d44da986f2bc9b72f5fe2 title: Step 82 challengeType: 0 dashedName: step-82 --- # --description-- Declare a `toNumberList` function which takes an `args` parameter, and returns the result of splitting the `args` by commas, and mapping the resulting array to `parseFloat`. # --hints-- You should declare a `toNumberList` variable. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*(?:const|let|var)\s+toNumberList\s*=/); ``` You should use `const` to declare your `toNumberList` variable. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=/); ``` Your `toNumberList` variable should be an arrow function. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(\(\s*(?:args)?\s*\)|args)\s*=>/); ``` Your `toNumberList` function should have an `args` parameter. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(\(\s*args\s*\)|args)\s*=>/); ``` Your `toNumberList` function should use an implicit return. ```js assert.notMatch(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(\(\s*args\s*\)|args)\s*=>\s*\{/); ``` Your `toNumberList` function should return the result of calling the `.split()` method of `args`. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(\(\s*args\s*\)|args)\s*=>\s*args\.split\(/); ``` You should split `args` on the `,` character. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(?:\(\s*args\s*\)|args)\s*=>\s*args\.split\(\s*('|"|`),\1\s*\)/); ``` You should chain the `.map()` method to the `.split()` method. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(?:\(\s*args\s*\)|args)\s*=>\s*args\.split\(\s*('|"|`),\1\s*\)\.map\(/); ``` You should pass a reference to `parseFloat` as the callback to `.map()`. ```js assert.match(code, /const\s+applyFunction\s*=\s*\(?\s*str\s*\)?\s*=>\s*\{\s*const\s+noHigh\s*=\s*highPrecedence\(\s*str\s*\);?\s*const\s+infix\s*=\s*\/\(\[(?:\\d\.|\.\\d)\]\+\)\(\[(?:\+-|-\+)\]\)\(\[(?:\\d\.|\.\\d)\]\+\)\/;?\s*const\s+str2\s*=\s*infixEval\(\s*noHigh\s*,\s*infix\s*\);?\s*const\s+functionCall\s*=\s*\/\(\[a-z\]\*\)\\\(\(\[0-9\., \]\*\)\\\)\(\?!\.\*\\\(\)\/i;?\s*const\s+toNumberList\s*=\s*(?:\(\s*args\s*\)|args)\s*=>\s*args\.split\(\s*('|"|`),\1\s*\)\.map\(\s*parseFloat\s*\);?/); ``` # --seed-- ## --seed-contents-- ```html