-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathwarmUp3.js
More file actions
35 lines (31 loc) · 1.2 KB
/
Copy pathwarmUp3.js
File metadata and controls
35 lines (31 loc) · 1.2 KB
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
// 1-Create arrays in the global scope consisting of strings that represent:
// -name of females in your class
// -name of males in your class
// -name of your class instructors
// 2-write a function that takes an array as an argument and returns the element that is located in the middle of that array.
<<<<<<< HEAD
// 3-Change all the numbers in the array to be multiplied by two for even indexes.
//srart
//////////----1
var femaleNames = ['Fatima', 'Tamara', 'Zahra', 'Noor'];
var maleNames = ['Ali', 'Adam', 'Hashem', 'Mohammed'];
var instrNames = ['Yousef', 'Seif', 'Mohammed', 'Omar'];
//////////----2
function middleArray(array) {
var arrEvenIndex =[];
if(array.length % 2 == 0 ) {
arrEvenIndex.push(array[array.length / 2] - 1) && arrEvenIndex.arrEvenIndex(array[(array.length / 2)])
}
return arrEvenIndex 2 ;
}
/////// ------3
function middleArray(array) {
var arrEvenIndex =[];
if(array.length % 2 == 0 ) {
arrEvenIndex.push((array[array.length / 2] - 1) * 2) && arrEvenIndex.arrEvenIndex((array[(array.length / 2)]) * 2)
}
return arrEvenIndex ;
//end
=======
// 3-Change all the numbers in the array to be multiplied by two for even indexes.
>>>>>>> 5351c491bef905428a1af3ea57f32fb6874d8e38