Below there are 6 variables with some values , I have to push this data in Array "socialMediaDetail" in below format ,how can I do that ? Please help suggest . This is kind off example ,Please help .
// Below 6 variables .
const Twittername = 'twitter';
const Twitterlink = 'HARIRAM @twitter.com';
const facebookname = 'facebook';
const facebooklink = 'VarnaHERO @facebook.com';
const linkedInname = 'linkedIn';
const linkedIlink = 'linkedIn @linkedin.com';
// in below format I have to store in array .
const socialMediaDetail = [{
"name": "twitter",
"link": "[email protected]"
}, {
"name": "facebook",
"link": "[email protected]"
}, {
"name": "linkedIn",
"link": "[email protected]"
}];
Thanks