commit 28b7f01009ae71b9d694d997d80488b131da731f Author: Alice Date: Fri Jun 5 14:20:55 2026 +0300 new repo diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b2846d8 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome", + "request": "launch", + "type": "chrome", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + }, + { + "type": "chrome", + "request": "launch", + "name": "Open javaScriptTester.html", + "file": "c:\\Users\\Dream\\JavaScript\\6\\javaScriptTester.html" + } + ] +} \ No newline at end of file diff --git a/5/5,2.js b/5/5,2.js new file mode 100644 index 0000000..fdcd74e --- /dev/null +++ b/5/5,2.js @@ -0,0 +1,6 @@ +let counter = 0; +let step = 4; +do{ + counter = counter + step; + console.log(counter); +} while(counter < 100) \ No newline at end of file diff --git a/5/5,3.js b/5/5,3.js new file mode 100644 index 0000000..096b73c --- /dev/null +++ b/5/5,3.js @@ -0,0 +1,9 @@ +let myWork = []; + +for (let i = 1; i <= 10; i++) { + let status = i % 2 === 0 ? true : false; + let lesson = { name: 'Lesson ' + i, status: status}; + myWork.push(lesson); +} + +console.log(myWork); \ No newline at end of file diff --git a/5/5,4.js b/5/5,4.js new file mode 100644 index 0000000..1dfc641 --- /dev/null +++ b/5/5,4.js @@ -0,0 +1,15 @@ +let strings = 20; +let columns = 10; + +let myTable = []; +let counter = 0; + +for (let y = 0; y < columns; y++){ + let tempTable = []; + for(let x = 0; x < strings; x++){ + counter++; + tempTable.push(counter); + } + myTable.push(tempTable); +} +console.table(myTable); \ No newline at end of file diff --git a/5/5,5.js b/5/5,5.js new file mode 100644 index 0000000..2fda32c --- /dev/null +++ b/5/5,5.js @@ -0,0 +1,15 @@ +const grid = []; +const cells = 64; +let counter = 0; +let row; +for (let x = 0; x < cells + 1; x++) { + if (counter % 8 == 0) { + if (row != undefined) { + grid.push(row); + } row = []; + } + counter++; + let temp = counter; + row.push(temp); +} +console.table(grid); \ No newline at end of file diff --git a/5/5,6.js b/5/5,6.js new file mode 100644 index 0000000..1090459 --- /dev/null +++ b/5/5,6.js @@ -0,0 +1,9 @@ +const myArray = []; +for (let x = 0; x < 10; x++) { + myArray.push(x + 1); +} +console.log(myArray); + +for (let val of myArray) { + console.log(val); +} \ No newline at end of file diff --git a/5/5,7.js b/5/5,7.js new file mode 100644 index 0000000..2a4885c --- /dev/null +++ b/5/5,7.js @@ -0,0 +1,15 @@ +const foods = { + pizza: "Italian", + rolls: "Japan", + korovai:"Russian" +}; +for (let prop in foods){ + console.log(prop, foods[prop]); //это в объекте +} + +console.log(" "); + +const arrFoods = ["pizza", "rolls", "korovai"]; +for (let food in arrFoods){ + console.log(food, arrFoods[food]); //это в массиве +} diff --git a/5/5,8.js b/5/5,8.js new file mode 100644 index 0000000..72510af --- /dev/null +++ b/5/5,8.js @@ -0,0 +1,9 @@ +let output = ""; +let pass = 3; +for (let i = 0; i < 10; i++){ + if (i === pass){ + break; + } + output += i; +} +console.log(output); \ No newline at end of file diff --git a/5/Projects/MathsTable.js b/5/Projects/MathsTable.js new file mode 100644 index 0000000..a65ef93 --- /dev/null +++ b/5/Projects/MathsTable.js @@ -0,0 +1,12 @@ +const table = []; + +const value = 24; + +for (let x = 0; x < value + 1; x++) { + const temp = []; + for (let y = 0; y < value + 1; y++){ + temp.push(x*y); + } + table.push(temp); +} +console.table(table); \ No newline at end of file diff --git a/6/6,1.js b/6/6,1.js new file mode 100644 index 0000000..819de85 --- /dev/null +++ b/6/6,1.js @@ -0,0 +1,8 @@ +function adder(a, b) { + return a + b; + +}; +const firstNumber = 545565; +const secondNumber = 5126215; +console.log(adder(firstNumber, secondNumber)); +console.log(adder(56415, 565258)) \ No newline at end of file diff --git a/6/6,2.js b/6/6,2.js new file mode 100644 index 0000000..4e0c097 --- /dev/null +++ b/6/6,2.js @@ -0,0 +1,10 @@ +const adj = ["крутой(-ая)", "красивый(-ая)", "плохой(-ая)", "злой(-ая)", "весёлый(-ая)", "осторожный(-ая)", "серьёзный(-ая)", "надменный(-ая)"]; + +function adjForName() { + const uName = prompt("Как тебя зовут?"); + const indexAdj = Math.floor(Math.random() * 5); + alert(uName + " - " + adj[indexAdj]); + console.log(uName + " - " + adj[indexAdj]); +} + +adjForName(); \ No newline at end of file diff --git a/6/javaScriptTester.html b/6/javaScriptTester.html new file mode 100644 index 0000000..beae4e8 --- /dev/null +++ b/6/javaScriptTester.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file