I have the following array of objects:
const pagesByBook = [
{bookName: "An old tome", pages: 123},
{bookName: "Really ancient stuff", pages: 432},
{bookName: "Yup, another old book", pages: 218}
]
And I would like to get the following string output:
const output= "['An old tome', 123, 'old', null],
['Really ancient stuff', 432, 'old', null],
['Yup, another old book', 218, 'old', null]"
How can I do this using in a few lines using ES6 methods such as map?
'old'come from, is that a constant?