Signed-off-by: Alice <Svfoxel@yandex.ru>

This commit is contained in:
2026-05-17 18:21:48 +03:00
parent 59ff9624d1
commit c00430cd72
15 changed files with 29 additions and 0 deletions
@@ -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"
}
]
}
@@ -0,0 +1,6 @@
let counter = 0;
let step = 4;
do{
counter = counter + step;
console.log(counter);
} while(counter < 100)
@@ -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);
@@ -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);
@@ -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);
@@ -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);
}
@@ -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]); //это в массиве
}
@@ -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);
@@ -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);
@@ -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))
@@ -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();
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<head> <meta charset="UTF-8"> </head>
<body>
<script type="text/javascript" src="6,2.js"> </script>
</body>