-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take an Arrow to the knee, Functionally
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Take an Arrow to the knee, Functionally | ||
|
||
https://www.codewars.com/kata/559f3123e66a7204f000009f | ||
|
||
**Arrow style Functions** | ||
|
||
Come here to practice the Arrow style functions Not much else to say good luck! | ||
|
||
**Details** | ||
|
||
You will be given an array of numbers which can be used using the String.fromCharCode() (JS), Tools.FromCharCode() (C#) method to convert the number to a character. It is recommended to map over the array of numbers and convert each number to the corresponding ascii character. | ||
|
||
**Examples** | ||
|
||
These are example of how to convert a number to an ascii Character: | ||
Javascript => String.fromCharCode(97) // a | ||
C# => Tools.FromCharCode(97) // a | ||
|
||
**Reference**: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { arrowFunc } from "./index"; | ||
|
||
describe("Tests", () => { | ||
it("arrowFunc", () => { | ||
expect(arrowFunc([84, 101, 115, 116])).toEqual("Test"); | ||
expect(arrowFunc([70, 85, 83, 32, 82, 79, 72, 32, 68, 65, 72])).toEqual("FUS ROH DAH"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function arrowFunc(numbers: number[]) { | ||
return numbers.map((item) => String.fromCharCode(item)).join(""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters