js.l23 code example
Example: js.l23
=======================================================================================
=====================================================================================
const obj = {
id: 16339202294,
name: 'Dulon',
age: 2021 - 1996,
address: '64-East,Mdpur,Dhaka',
friends: ['sisir', 'razzak', 'rahat']
}
console.log(obj);
console.log(obj.name, obj.age);
console.log(obj['friends']);
const InterestedTo = prompt('Know about her: [id,name,age,address or frienda]:')
if (obj[InterestedTo]) {
console.log(`true property: ${obj[InterestedTo]}`);
} else {
console.log(`Error Typing: `);
}
const obj = {
id: 16339202294,
name: 'Dulon',
age: 2021 - 1996,
address: '64-East,Mdpur,Dhaka',
friends: ['sisir', 'razzak', 'rahat']
}
console.log(obj);
obj.addelement = 'bangladesh';
obj['addElement'] = '@dulon1254';
console.log(obj);