I am having mapping function like this below where i am assigning this object to searchable drop down list in other page
const mapOptions =
equipmentDensitySourceTypeData !== (undefined && null)
? equipmentDensitySourceTypeData.libraryEquipment.map(code => ({
label:
code.equipmentSource.name -
code.equipmentSource.edition -
code.category -
code.spaceFunction -
code.revision,
key: code.id,
}))
: null;
here only the revision is integer and remaining all are strings when i check mapOptions
object i am getting label
value as NaN
and for key i am getting correct value ..
I am looking for label should be string separated by -
I am not sure where i am doing wrong with this one, Could any please suggest any idea on this.. I am using React JS with ES6 for the above code
PS : I also tried like this ${code.category}
- ${code.spaceFunction}
but getting same NaN