MCPcopy Create free account
hub / github.com/appacademy/Module-1-Resources / groceryList

Function groceryList

w2/d4/closure.js:63–70  ·  view source on GitHub ↗
(list)

Source from the content-addressed store, hash-verified

61we can access and change the outer functions variables
62*/
63function 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/* <>: {

Callers

nothing calls this directly

Calls 1

addItemFunction · 0.85

Tested by

no test coverage detected