готово

This commit is contained in:
codevadym 2025-02-05 10:26:41 +01:00
parent bed50036f1
commit bed4686600
3 changed files with 40 additions and 0 deletions

View File

@ -11,3 +11,31 @@
* *
* 4. Выведите результирующий массив в консоль * 4. Выведите результирующий массив в консоль
*/ */
const cars = [
{
carBand: 'BMW',
price: 1000,
insAvalibleForSale: true,
},
{
carBand: 'Porsche',
price: 1100,
isAvailableForSale: false,
},
{
carBand: 'Moscvich',
price: 1200,
isAvailableForSale: true,
}
]
const newCar = {
carBand: 'Lada',
price: 1200,
isAvailableForSale: true,
}
cars.push(newCar)
console.log(cars)

View File

@ -13,3 +13,11 @@ const myObject = {
key4: null, key4: null,
key10: NaN, key10: NaN,
} }
const objectKeys = Object.keys(myObject)
objectKeys.forEach((key) => {
if (key === 'key1' || key === 'key3') {
console.log(myObject[key])
}
})

View File

@ -18,3 +18,7 @@ const MIN = 1000
const MAX = 9999 const MAX = 9999
const myNumbers = [2355, 7235, 8135, 1762, 2361, 8351] const myNumbers = [2355, 7235, 8135, 1762, 2361, 8351]
const randomNumber = Math.floor(Math.random() * (MAX - MIN + 1)) + MIN;
console.log(randomNumber);