Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to add key value pair in object

// program to add a key/value pair to an object

const person = {
    name: 'Monica',
    age: 22,
    gender: 'female'
}

// add a key/value pair
person.height = 5.4;

console.log(person);
Comment

PREVIOUS NEXT
Code Example
Javascript :: ndjson to json javascript 
Javascript :: js random unique id 
Javascript :: vscode js intellisence not working 
Javascript :: get json data into array of object 
Javascript :: javascript convert input to lowercase 
Javascript :: how to enable emit on react in vs code 
Javascript :: js detect if content editable div is empty 
Javascript :: invoking jquery validator 
Javascript :: javascript countdown 
Javascript :: javascript get character from string 
Javascript :: jquery remove multiple class 
Javascript :: declare multiple variables javascript 
Javascript :: how to find last occurrence comma in a string and replace with value in javascript 
Javascript :: trigger modal after some time react js 
Javascript :: foreach method javascript 
Javascript :: discord.js remove embed from message 
Javascript :: difference between undefined and null javascript 
Javascript :: mod operation in shopify 
Javascript :: javascript date parse yyyy-mm-dd 
Javascript :: javascript https post 
Javascript :: how to use useref hook in react 
Javascript :: funciones invocan a funciones javascript 
Javascript :: abrir dialog angular materia 
Javascript :: push object to json array 
Javascript :: body-parser is depreciated 
Javascript :: how to make first letter uppercase in javascript 
Javascript :: socket.io cdn 
Javascript :: jquery carousel slide event 
Javascript :: firebase messaging import script 
Javascript :: string.fromcharcode 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =