Skip to content

Commit e2382c7

Browse files
committed
add more than problem
1 parent 78d42b3 commit e2382c7

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@
3232
| Problem - 28 | [Make a unique random string generator - uuid alternative lite](https://github.com/MehedilslamRipon/Problem-solving-with-JavaScript/blob/master/problem-28.js) |
3333
| Problem - 29 | [Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives](https://github.com/anasmak04/Problem-solving-with-JavaScript/blob/master/problem-29.js) |
3434
| Problem - 30 | [Thinkful-Logic](https://github.com/anasmak04/Problem-solving-with-JavaScript/blob/master/problem-30.js) |
35-
<!-- | Problem - 31 | | -->
35+
| Problem - 31 | [You Need Only One](https://github.com/anasmak04/Problem-solving-with-JavaScript/blob/master/problem-31.js) |
36+
| Problem - 32 | [Repeat str](https://github.com/anasmak04/Problem-solving-with-JavaScript/blob/master/problem-32.js) |
37+
<!-- | Problem - 33 | | -->

Diff for: problem-31.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// You will be given an array a and a value x. All you need to do is check whether the provided array contains the value.
2+
3+
// Array can contain numbers or strings. X can be either.
4+
5+
// Return true if the array contains the value, false if not.
6+
7+
8+
function check(a, x) {
9+
// your code here
10+
for (let item of a) {
11+
if (x == item) {
12+
return true
13+
}
14+
}
15+
return false;
16+
}
17+
18+
console.log(check([1, 2], 5))

Diff for: problem-32.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function Repeatstr(n,s){
2+
let str = "";
3+
for(let i = 0 ; i < n ; i++ ){
4+
str+=s;
5+
}
6+
return str;
7+
8+
9+
}
10+
11+
console.log(Repeatstr(3,'*'))

0 commit comments

Comments
 (0)