--- title: Generate lower case ASCII alphabet id: 5a23c84252665b21eecc7e7a challengeType: 5 --- ## Description
Write a function to generate an array of lower case ASCII characters, for a given range. For example: for range 1 to 4 the function should return ['a','b','c','d'].
## Instructions
## Tests
```yml tests: - text: lascii should be a function. testString: assert(typeof lascii=='function','lascii should be a function.'); - text: lascii("a","d") should return an array. testString: assert(Array.isArray(lascii('a','d')),'lascii("a","d") should return an array.'); - text: "lascii('a','d') should return [ 'a', 'b', 'c', 'd' ]." testString: assert.deepEqual(lascii("a","d"),results[0],"lascii('a','d') should return [ 'a', 'b', 'c', 'd' ]."); - text: lascii('c','i') should return [ 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]. testString: assert.deepEqual(lascii("c","i"),results[1],"lascii('c','i') should return [ 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]."); - text: lascii('m','q') should return [ 'm', 'n', 'o', 'p', 'q' ]. testString: assert.deepEqual(lascii("m","q"),results[2],"lascii('m','q') should return [ 'm', 'n', 'o', 'p', 'q' ]."); - text: lascii('k','n') should return [ 'k', 'l', 'm', 'n' ]. testString: assert.deepEqual(lascii("k","n"),results[3],"lascii('k','n') should return [ 'k', 'l', 'm', 'n' ]."); - text: lascii('t','z') should return [ 't', 'u', 'v', 'w', 'x', 'y', 'z' ]. testString: assert.deepEqual(lascii("t","z"),results[4],"lascii('t','z') should return [ 't', 'u', 'v', 'w', 'x', 'y', 'z' ]."); ```
## Challenge Seed
```js function lascii (cFrom, cTo) { // Good luck! } ```
### After Test
```js let results=[ [ 'a', 'b', 'c', 'd' ], [ 'c', 'd', 'e', 'f', 'g', 'h', 'i' ], [ 'm', 'n', 'o', 'p', 'q' ], [ 'k', 'l', 'm', 'n' ], [ 't', 'u', 'v', 'w', 'x', 'y', 'z' ] ] ```
## Solution
```js function lascii(cFrom, cTo) { function cRange(cFrom, cTo) { var iStart = cFrom.charCodeAt(0); return Array.apply( null, Array(cTo.charCodeAt(0) - iStart + 1) ).map(function (_, i) { return String.fromCharCode(iStart + i); }); } return cRange(cFrom, cTo); } ```