object inside object javascript
person = {
'name':'john smith'
'age':41
};
console.log(person);
//this will return [object Object]
//use
console.log(JSON.stringify(person));
//insteadvar obj = {
prop1: 5,
obj2: {
prop1: [3, 6, 3],
prop2: 74,
prop3: {
str: "Hello World"
}
}
};
console.log(obj.obj2.prop3.str); //output: "Hello World"let object = {
'key1': 'value1',
'key2': 'value2',
'keyn': 'valuen',
};
console.log(object);var mycar = new Car('Eagle', 'Talon TSi', 1993);
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}
Also in JavaScript:
- javascript replace string
- js errors
- js code to run hello world
- glide.js autoplay
- mongoose find by and delete
- object set js
- método pop javascript
- difference between React Native and React
- css defer async
- Javascript check for hash in URL
- javascript object to array
- how to set dynamic size in react js
- adding a terminal iframe
- Vuejs v-model when enter pressed
- js date methods
- jquery clear html
- how to replace first and last character of string in javascript
- react data attributes event
- upload multiple image using jquery
- convert base64 to image javascript
- chartjs min
- javascript appendchild image node
- error handling in node js
- How to test useEffect in react testing library