Skip to content Skip to sidebar Skip to footer

Of Ampersands, Object Properties, And Buttons' Innerhtmls

I'm writing a JS script that has an object with &'s in some of its properties, e.g. var topicObj = { 'Client & Peripherals': ['USB', 'Printer', 'Copy/Paste'], 'Install

Solution 1:

You are using the for of loop.

selMTopic = "Client & Peripherals"
for (let t of topicObj[selMTopic])) {
   console.log(t);  // Check this value
   addTopic(topicsDD,t);  // Something like this
}

Post a Comment for "Of Ampersands, Object Properties, And Buttons' Innerhtmls"