This commit is contained in:
szabomarton 2024-09-06 09:26:35 +02:00
parent e7a1e2cc05
commit b8b369a932
3 changed files with 92 additions and 5 deletions

22
20240906/karacsonyfa.js Normal file
View 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
View 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);

View File

@ -1,11 +1,55 @@
if (true) {
var x = 10;
let x;
if (true){
x = 25;
}
if (true){
y = 10;
}
console.log(x);
console.log(y);
function MyFunction(){
var y = 15;
const z = 25;
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);