Skip to content

Commit d4776d7

Browse files
committed
question added
1 parent 90fa699 commit d4776d7

File tree

3 files changed

+64
-6
lines changed

3 files changed

+64
-6
lines changed

Problem.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@
3838
#38: Create a function that takes a base number and an exponent number and returns the calculation.
3939
#39: Create a function that takes two numbers as arguments and return their sum.
4040
#40: Create a function that will merge two arrays and return the result as a new array
41+
#41: Create a function that will receive two arrays of numbers as arguments and return an array composed of all the numbers that are either in the first array or second array but not in both
42+
4143

4244

4345

4446

4547

46-
#26: Create a function that will receive two arrays of numbers as arguments and return an array composed of all the numbers that are either in the first array or second array but not in both
4748
#27: Create a function that will receive two arrays and will return an array with elements that are in the first array but not in the second
4849
#28: Create a function that will receive an array of numbers as argument and will return a new array with distinct elements
4950
#29: Calculate the sum of first 100 prime numbers

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
1-
## JavaScript Problem Solving
2-
3-
**#1: Print in Console from 1 to 10 numbers?**
1+
# JavaScript Problem Solving
2+
3+
1. [Print in Console numbers from 1 to 10](#1:)
4+
2. Print in Console the odd numbers less than 100
5+
3. Print in Console the multiplication table with 7
6+
4. Calculate the sum of numbers from 1 to 10
7+
5. Calculate 10!
8+
6. Calculate the sum of odd numbers greater than 10 and less than 30
9+
7. Calculate the sum of numbers in an array of numbers
10+
8. Calculate the average of the numbers in an array of numbers
11+
9. Find the maximum number in an array of numbers
12+
10. Create a function that receives an array of numbers and returns an array containing only the positive numbers
13+
11. Print in Console all the multiplication tables with numbers from 1 to 10
14+
12. Create a function that will convert from Celsius to Fahrenheit
15+
13. Create a function that will convert from Fahrenheit to Celsius
16+
14. Print in Console the first 10 Fibonacci numbers without recursion
17+
15. Create a function that will find the nth Fibonacci number using recursion
18+
16. Check Leap Year Using if...else?
19+
17. Create a function that accepts an array and returns the last item in the array.
20+
18. Calculate the sum of digits of a positive integer number
21+
19. Print in Console the first 100 prime numbers
22+
20. Check Odd or Even Number with Arguments Objects
23+
21. Create a function that will return in an array the first "nPrimes" prime numbers greater than a particular number "startAt"
24+
22. Rotate an array to the left 1 position
25+
23. Reverse an array with createed function, don`t Change orginal array #24: Reverse an array with JavaScript Builtin Method
26+
24. Reverse a string with JavaScript Builtin Method
27+
25. Reverse a string with createed function, don`t Change orginal string
28+
26. Create a function that takes an array and returns the types of values (data types) in a new array.
29+
27. Create a function that will return in an array. becarefull function parameter and array length is same in count.
30+
28. Create a function that takes the age in years and returns the age in days.
31+
29. Create a function that takes voltage and current and returns the calculated power.
32+
30. Given two numbers, return true if the sum of both numbers is less than 50. Otherwise return false.
33+
31. Write a function that takes minutes and converts it to seconds.
34+
32. Write a function that converts hours into seconds.
35+
33. Create a function that takes an array containing only numbers and return the first element.
36+
34. Create a function that finds the maximum range of a triangle's third edge, where the side lengths are all integers.
37+
35. Write a function that takes the base and height of a triangle and return its area.
38+
36. Create a function that takes a number as an argument, increments the number by +1 and returns the result.
39+
37. Create a function that takes a base number and an exponent number and returns the calculation.
40+
38. Create a function that takes two numbers as arguments and return their sum.
41+
39. Create a function that will merge two arrays and return the result as a new array
42+
40. Create a function that will receive two arrays of numbers as arguments and return an array composed of all the numbers that are either in the first array or second array but not in both
43+
44+
### 1: Print in Console from 1 to 10 numbers?
445

546
```
647

script.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@ function addition(a, b) {
317317
return a + b;
318318
}
319319
320-
*/
321-
322320
// #40: Create a function that will merge two arrays and return the result as a new array
323321
const mergeArrays = (arr1, arr2) => {
324322
return [...arr1, ...arr2];
@@ -340,3 +338,21 @@ function mergeArrays(arr1, arr2) {
340338
return arr;
341339
}
342340
console.log(mergeArrays([5, 3, 6], [8, 7]));
341+
342+
*/
343+
344+
// #41: Create a function that will receive two arrays of numbers as arguments and return an array composed of all the numbers that are either in the first array or second array but not in both
345+
function mergeArrays(arr1, arr2) {
346+
var arr = [];
347+
348+
for (let element of arr1) {
349+
arr.push(element);
350+
}
351+
352+
for (let element of arr2) {
353+
arr.push(element);
354+
}
355+
356+
return arr;
357+
}
358+
console.log(mergeArrays([5, 3, 6], [8, 7]));

0 commit comments

Comments
 (0)