asd
This commit is contained in:
parent
e7a1e2cc05
commit
b8b369a932
22
20240906/karacsonyfa.js
Normal file
22
20240906/karacsonyfa.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
for (let i = 1; i < 8; i++){
|
||||||
|
|
||||||
|
let starnum = i + i - 1;
|
||||||
|
//console.log(starnum);
|
||||||
|
let spacenum = (13 - starnum) / 2;
|
||||||
|
//console.log(spacenum);
|
||||||
|
|
||||||
|
let space = ' ';
|
||||||
|
let star = '*';
|
||||||
|
|
||||||
|
let line = space.repeat(spacenum) + star.repeat(starnum) + space.repeat(spacenum);
|
||||||
|
|
||||||
|
console.log(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
let spnum = (13 - 3) / 2;
|
||||||
|
let barnum = 13 - spnum;
|
||||||
|
|
||||||
|
|
||||||
|
for (let i = 0; i < 2; i++){
|
||||||
|
let line =
|
||||||
|
}
|
21
20240906/operatorok.js
Normal file
21
20240906/operatorok.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
let x = 25;
|
||||||
|
let y = "25";
|
||||||
|
|
||||||
|
console.log(x == y);
|
||||||
|
console.log(x === y);
|
||||||
|
|
||||||
|
let text = "szoveg";
|
||||||
|
console.log(text + x);
|
||||||
|
console.log(x+y);
|
||||||
|
|
||||||
|
console.log(typeof(x));
|
||||||
|
|
||||||
|
const tomb = new Array(1,2,3,4,5);
|
||||||
|
console.log(tomb instanceof Array);
|
||||||
|
|
||||||
|
//instanceof - true ha a vizsgált objektum egy példánya
|
||||||
|
|
||||||
|
// léptető operátorok num++, num--;
|
||||||
|
|
||||||
|
console.log(x++);
|
||||||
|
console.log(++x);
|
|
@ -1,11 +1,55 @@
|
||||||
|
let x;
|
||||||
|
|
||||||
if (true){
|
if (true){
|
||||||
var x = 10;
|
x = 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (true){
|
||||||
|
y = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(x);
|
console.log(x);
|
||||||
|
console.log(y);
|
||||||
|
|
||||||
function MyFunction(){
|
const z = 25;
|
||||||
var y = 15;
|
if (true){
|
||||||
|
console.log("Blokkon belül: " + z);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(y);
|
console.log("Blokkon kívül: " + z);
|
||||||
|
|
||||||
|
|
||||||
|
if (true){
|
||||||
|
const a = 89;
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(a);
|
||||||
|
|
||||||
|
|
||||||
|
function Person(name, age){
|
||||||
|
this.name = name;
|
||||||
|
this.age = age;
|
||||||
|
}
|
||||||
|
|
||||||
|
let person1 = new Person("janos", 19);
|
||||||
|
|
||||||
|
console.log(person1.name);
|
||||||
|
console.log(person1.age);
|
||||||
|
|
||||||
|
let jatek = {
|
||||||
|
nev: "Minecraft",
|
||||||
|
fejleszto: "Mojang",
|
||||||
|
megjelenés: 2009
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(jatek.nev);
|
||||||
|
|
||||||
|
let nums = [1,3,4,6,9];
|
||||||
|
console.log(nums);
|
||||||
|
|
||||||
|
let userMap = new Map();
|
||||||
|
userMap.set('name', 'Kristóf');
|
||||||
|
console.log(userMap);
|
||||||
|
|
||||||
|
let numset = new Set([1,2,3,4,5]);
|
||||||
|
console.log(numset);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user