-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEx.3.html
42 lines (35 loc) · 1.17 KB
/
Ex.3.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
41
42
<!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.3</h1>
<h3><a href="./Ex.2.html">Link to previos!</a></h3>
<h3><a href="./Ex.4.html">Link to next!</a></h3>
<p>Time to test your basic knowledge in functions! Return the odds from a list:</p>
<i>odds([1,2,3,4,5]) #=> [1,3,5]</i>
<h2>My solution</h2>
<div class="code">
<pre>function odds(values) {<br /> return values.filter((value) => value % 2 !== 0);<br />}</pre>
</div>
<h2 class="passed">PASSED</h2>
<h3>Time: 439ms</h3>
<script>
//MY SOLUTION
function odds(values) {
return values.filter((value) => value % 2 !== 0);
}
console.log(odds([1, 2, 3, 4, 5]));
// BEST SOLUTION
`SAME`
</script>
</body>
</html>