Defining Objects

From rbachwiki
Revision as of 15:48, 21 October 2016 by Bacchas (talk | contribs) (Created page with "<pre> var comptype = { brand: 'ibm', ram: '128 Gigs', hdrive: '1 Terabyte' } </pre> ===Loop through items== for(var item in comptype){ console.log(item + " - " + compty...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 var comptype = {
 brand: 'ibm',
 ram: '128 Gigs',
 hdrive: '1 Terabyte'

}

=Loop through items

for(var item in comptype){
console.log(item + " - " + comptype[item]);