(list)
| 61 | we can access and change the outer functions variables |
| 62 | */ |
| 63 | function groceryList(list) { |
| 64 | function addItem() { |
| 65 | list.push("ice cream"); |
| 66 | } |
| 67 | |
| 68 | addItem(); |
| 69 | return list; |
| 70 | } |
| 71 | // console.log(groceryList(['bacon','mangos']));// [ 'bacon', 'mangos', 'ice cream' ] |
| 72 | |
| 73 | /* <>: { |