diff --git a/34-array-of-objects/start.js b/34-array-of-objects/start.js index 16e28d5..0bc04e2 100755 --- a/34-array-of-objects/start.js +++ b/34-array-of-objects/start.js @@ -11,3 +11,31 @@ * * 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) \ No newline at end of file diff --git a/35-object-iteration/start.js b/35-object-iteration/start.js index 63121cf..51aef6c 100755 --- a/35-object-iteration/start.js +++ b/35-object-iteration/start.js @@ -13,3 +13,11 @@ const myObject = { key4: null, key10: NaN, } + +const objectKeys = Object.keys(myObject) + +objectKeys.forEach((key) => { + if (key === 'key1' || key === 'key3') { + console.log(myObject[key]) + } +}) diff --git a/36-random-numbers/start.js b/36-random-numbers/start.js index ebfd755..84f50b5 100755 --- a/36-random-numbers/start.js +++ b/36-random-numbers/start.js @@ -18,3 +18,7 @@ const MIN = 1000 const MAX = 9999 const myNumbers = [2355, 7235, 8135, 1762, 2361, 8351] + +const randomNumber = Math.floor(Math.random() * (MAX - MIN + 1)) + MIN; + +console.log(randomNumber); \ No newline at end of file