Skip to content
Permalink
3a2c555ac9
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
25 lines (22 sloc) 464 Bytes
'use strict'
const list = require('./modules/shopping')
debugger
list.add('bread')
list.add('butter')
debugger
list.add('cheese')
list.add('bread')
list.add('bread')
list.add('butter')
debugger
try {
list.decrement('bread', 2)
list.decrement('butter', 4)
list.decrement('jam', 3)
} catch(err) {
console.log('ERROR: '+err.message)
}
const items = list.getAll()
items.forEach( (element, index) => {
console.log(index+'. '+element.title+'\t x'+element.qty)
})