let band = {
name: "Bon Jovi",
nationality: "USA",
genre: "rock",
members: 5,
formed: 1983,
split: false,
album: [{
name: "Slippery When Wet",
released: 1986,
}, {
name: "Crush",
released: 2000,
}]
};
function isEnd(split) {
if (split === false) {
return ["s", "now"];
} else {
return ["d", split];
}
}
const bandInfo = `${band.name} is a ${band.genre} band from ${band.nationality}. This ${band.members} members band active${isEnd(band.split)[0]} from ${band.formed} until ${isEnd(band.split)[1]}. Their succesful albums include ${band.album[0].name}, released ${band.album[0].released}, and ${band.album[1].name}, released ${band.album[1].released}.`
bandInfo;
// 'Bon Jovi is a rock band from USA. This 5 members band actives from 1983 until now. Their succesful albums include Slippery When Wet, released 1986, and Crush, released 2000.'
// If band.split = 2021, the bandInfo becoming:
// 'Bon Jovi is a rock band from USA. This 5 members band actived from 1983 until 2021. Their succesful albums include Slippery When Wet, released 1986, and Crush, released 2000.'