Skip to content

Commit 9b65d3f

Browse files
author
juanantonioledesma
committed
Add "Simple Comparison?" kata
1 parent 2b2c23d commit 9b65d3f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

8-kyu/simple-comparison.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<h1>Simple Comparison? <sup><sup>8 Kyu</sup></sup></h1>
2+
3+
<sup>
4+
<a href="https://www.codewars.com/kata/57f6ecdfcca6e045d2001207">
5+
<strong>LINK TO THE KATA</strong>
6+
</a> - <code>FUNDAMENTALS</code> <code>STRINGS</code>
7+
</sup>
8+
9+
## Description
10+
11+
Write a function that will compare two values, one will be a number and one will be a string. Return `true` if they are the same character (regardless of their different data types) and return `false` if they are not.
12+
13+
To make this challange harder and to promp the challenger to read up about coercion I have disabled some of the built in methods including `.toString()`, `.join()`, `.split()`, `parseInt` and `.Number()`.
14+
15+
## Solution
16+
17+
```javascript
18+
const add = (a, b) => a == b
19+
```

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ JavaScript katas on Codewars are programming challenges that help you improve yo
7373
- **[Object Oriented Piracy](./8-kyu/object-oriented-piracy.md)**
7474
- **[Opposites Attract](./8-kyu/opposites-attract.md)**
7575
- **[Power](./8-kyu/power.md)**
76+
- **[Simple Comparison?](./8-kyu/simple-comparison.md)**

0 commit comments

Comments
 (0)