diff --git a/bike-shop/src/stage1-literals.js b/bike-shop/src/stage1-literals.js index c749dd2..2f0ea1c 100644 --- a/bike-shop/src/stage1-literals.js +++ b/bike-shop/src/stage1-literals.js @@ -1,5 +1,21 @@ const myBike = { // your code here + name: "Roadster", + price: 199.99, + frame: { + height: 55, + color: 'blue', + style: 'cruiser' + }, + brakes: { + front: false, + back: true, + }, + tires: { + diameter: 22, + type: 'fat' + }, + rings: [2, 5] } module.exports = myBike diff --git a/jsinfo/helloObject.js b/jsinfo/helloObject.js new file mode 100644 index 0000000..2445a6a --- /dev/null +++ b/jsinfo/helloObject.js @@ -0,0 +1,9 @@ +let user = {}; +//console.log(user); +user.name = "John"; +//console.log(user.name); +user.surname = "Smith"; + +user.name = "Pete"; +//console.log(user.name); +delete user.name; diff --git a/jsinfo/multiplyNumeric.js b/jsinfo/multiplyNumeric.js new file mode 100644 index 0000000..a5f51d0 --- /dev/null +++ b/jsinfo/multiplyNumeric.js @@ -0,0 +1,16 @@ +let testOb = { + first: "soup", + second: 500, +} + +function multiplyNumeric(obect) { + for (props in obect) { + if (typeof obect[props] === 'number') { + obect[props] = (obect[props] * 2); + } + } +} + +multiplyNumeric(testOb); + +console.log(testOb);