-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ex.13.html
40 lines (35 loc) · 1.07 KB
/
Ex.13.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Fira+Sans+Extra+Condensed" rel="stylesheet">
<title>Document</title>
</head>
<body>
<img src="https://www.codewars.com/users/stefan835/badges/large" alt="codewars-badge">
<h1>Ex.13</h1>
<h3><a href="./Ex.12.html">Link to previos!</a></h3>
<h3><a href="./Ex.14.html">Link to next!</a></h3>
<p>Very simple, given a number, find its opposite.</p>
<p>Examples:</p>
<pre><code>1: -1
14: -14
-34: 34
</code></pre>
<p>But can you do it in 1 line of code and without any conditionals?</p>
<h2>My solution</h2>
<div class="code">
<pre>const opposite = number => -number;</pre>
</div>
<h2 class="passed">PASSED</h2>
<h3>Time: 525ms</h3>
<script>
//MY SOLUTION
const opposite = number => -number;
</script>
</body>
</html>