diff --git a/20240906/karacsonyfa.js b/20240906/karacsonyfa.js new file mode 100644 index 00000000..7f4d10ac --- /dev/null +++ b/20240906/karacsonyfa.js @@ -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 = +} diff --git a/20240906/operatorok.js b/20240906/operatorok.js new file mode 100644 index 00000000..229f0844 --- /dev/null +++ b/20240906/operatorok.js @@ -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); diff --git a/20240906/script.js b/20240906/script.js index d7acb303..cb6235bf 100644 --- a/20240906/script.js +++ b/20240906/script.js @@ -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); \ No newline at end of file +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);