added some thing
This commit is contained in:
parent
d75f655704
commit
9a7fbd17e5
33
24_10_01/script.js
Normal file
33
24_10_01/script.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
let tomb = [1,2,3,4,5];
|
||||
let [a,b,c] = tomb;
|
||||
|
||||
console.log(a);
|
||||
console.log(b);
|
||||
console.log(c);
|
||||
|
||||
let tomb2 = [10,20];
|
||||
let [a1, b1, c1, d1 = 30] = tomb2;
|
||||
console.log(a1);
|
||||
console.log(b1);
|
||||
console.log(c1);
|
||||
console.log(d1);
|
||||
|
||||
let [elso, , ...maradek] = tomb;
|
||||
console.log(elso);
|
||||
console.log(maradek);
|
||||
|
||||
let ember = {nev: "Lajos", kor: 25, nem: "Férfi"};
|
||||
|
||||
let {nev: emberNeve, kor} = ember;
|
||||
|
||||
console.log(emberNeve);
|
||||
console.log(kor);
|
||||
|
||||
let {nev, sport = "Foci"} = ember;
|
||||
console.log(nev);
|
||||
console.log(sport);
|
||||
|
||||
//rest operátor
|
||||
let {nev: szemely, ...maradekok} = ember;
|
||||
console.log(szemely);
|
||||
console.log(maradekok);
|
Loading…
Reference in New Issue
Block a user