--- id: 587d7b7e367417b2b2512b22 title: Use the parseInt Function with a Radix challengeType: 1 videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(/parseInt/g.test(code), "convertToInteger should use the parseInt() function");' - text: '' testString: 'assert(typeof(convertToInteger("10011")) === "number", "convertToInteger("10011") should return a number");' - text: '' testString: 'assert(convertToInteger("10011") === 19, "convertToInteger("10011") should return 19");' - text: '' testString: 'assert(convertToInteger("111001") === 57, "convertToInteger("111001") should return 57");' - text: '' testString: 'assert.isNaN(convertToInteger("JamesBond"), "convertToInteger("JamesBond") should return NaN");' ```
## Challenge Seed
```js function convertToInteger(str) { } convertToInteger("10011"); ```
## Solution
```js // solution required ```