javascript return object code example
Example 1: how to return an object in javascript
function func() {
return {
name: "Name",
age: 34
};
}
Example 2: javascript object
let names = {
name1: 'What ever you want to put'
}
function func() {
return {
name: "Name",
age: 34
};
}
let names = {
name1: 'What ever you want to put'
}