This.stack.push(layer);

my code is same as arnav sir i have copied out of frustation still it shows TypeError: Cannot read property ‘push’ of undefined

Send the code and the entire stack trace of the error