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 :: regex exact match 
Javascript :: js example 
Javascript :: react pdf 
Javascript :: localhost server in react native 
Javascript :: electron in webpack 
Javascript :: codemirror get object from textarea 
Javascript :: how to stop overlapping divs to interact with each others click events 
Javascript :: node js install aws-sdk 
Javascript :: server mail 
Javascript :: jquery button click confirm and validate before submit 
Javascript :: ReactComponent as Icon 
Javascript :: convert javascript to ruby 
Javascript :: js filter text 
Javascript :: textbox value length in javascript 
Javascript :: sprintf js 
Javascript :: asynchronous function using function constructor 
Javascript :: convert json string to byte array java 
Javascript :: check if field exists in object javascript 
Javascript :: react clone element 
Javascript :: input element change event data 
Javascript :: nesting express routes 
Javascript :: javascript Clone Array Using Spread Operator 
Javascript :: React native pdf creater html-to-pdf 
Javascript :: strict equality operator 
Javascript :: axios put api in componentDidMount React 
Javascript :: .catch chain 
Javascript :: Capitalize word 
Javascript :: react native firebase login with facebook 
Javascript :: angular material open last visited tab 
Javascript :: plus in javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =