const obj={
brand:'Apple',
color:'Red',
price:'300'
}
Object.keys(obj).forEach((key)=>{
const value=obj[key]
const firstvalue=key.charAt(0).toUpperCase()+key.slice(1);
obj[key]=firstvalue
}
)
const obj={
brand:'Apple',
color:'Red',
price:'300'
}
const updateDb={}
Object.keys(obj).forEach((key)=>{
const value=obj[key]
const firstvalue=key.charAt(0).toUpperCase()+key.slice(1);
console.log(firstvalue)
updateDb[key]=firstvalue
}
)
console.log(updateDb)
return updateDb
Top comments (0)