javascript object
person = {
'name':'john smith'
'age':41
};
console.log(person);
//this will return [object Object]
//use
console.log(JSON.stringify(person));
//insteadlet car = {
name: "BMW",
colour: "black",
year: "2020",
owner: {
names = ["Andy" , "Steve" , "Tony" ]
}
};let obj = {
// fields
name:"value",
num: 123,
//methods
foo: function(){}
}var person = {
first_name : "Marty",
last_name : "Mcfly",
born : 1968,
died : 1933,
lovers: ["Jennifer Parker","Baines McFly"]
};const object = {
something: "something";
}let names = {
name1: 'What ever you want to put'
}
Also in JavaScript:
- how to get a random element of an array javascript
- clear input field jquery
- sticky operations in javascript
- express
- javascript variables
- how to download array of files from aws s3 using aws sdk in nodejs
- foreach db mongodb
- how to check palindrome in javascript for lowercase and uppercase
- node get path of current file
- split and join in node js
- value from getelementbyid
- react fun tion
- color js
- Create a server which serves at port 3000 and with node.js command prompt
- find in string javascript
- react get current route
- js try..catch works synchronously.
- javascript write to file and download
- change src of iframe jquery
- deleteicon material ui improt
- split a message js
- jquery automatically click message alert
- findindex js
- box shadow javascript style change