-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex6.js
More file actions
28 lines (24 loc) · 744 Bytes
/
ex6.js
File metadata and controls
28 lines (24 loc) · 744 Bytes
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
let masiw = ["Alina", 1999, true];
masiw.push("Maksim");
masiw.unshift(1999);
masiw.pop();
masiw.shift();
masiw[1] = 2000;
masiw.splice(masiw.length/2, 0 , "Privet", 2020);
// masiw = masiw.join("-");
let animals = ["Cat", "Dog", "Cow", "Snake", "Rabbit", "Shark"];
// animals = animals.slice(-2);
let wmeste = masiw.concat(animals);
console.log(animals.indexOf("Dog"));
function alinasFunction(x, y) {
return x + y + 1;
}
const alinasFunction2 = (x, y) => x + 1;
let zero = [];
animals.forEach(animal => zero.push(animal))
// zero = animals.map(animal => animal);
// animals.forEach(animal => zero += animal + ", ")
let per2 = animals.map(item => item)
// for (let i = 0; i < animals.length; i++) {
// console.log(animals[i])
// }