()
| 94 | let myFunc = () => "hey"; |
| 95 | |
| 96 | function elephantCollector() { |
| 97 | let elephants = ["dumbo"]; |
| 98 | |
| 99 | // return named function |
| 100 | return function inner(name) { |
| 101 | elephants.push(name); |
| 102 | return elephants; |
| 103 | }; |
| 104 | |
| 105 | // return anonymous func |
| 106 | return function (name) { |
| 107 | elephants.push(name); |
| 108 | return elephants; |
| 109 | }; |
| 110 | |
| 111 | return (name) => { |
| 112 | elephants.push(name); |
| 113 | return elephants; |
| 114 | }; |
| 115 | |
| 116 | return inner |
| 117 | |
| 118 | } |
| 119 | // console.log(elephantCollector);//[Function: elephantCollector] |
| 120 | // console.log(elephantCollector());//[Function: inner] |
| 121 |
nothing calls this directly
no outgoing calls
no test coverage detected