Sometimes you eat the bear and sometimes the bear eats you.
Basic logic implementation of a game where the bear must be fed every ten seconds or the user will be eaten. Utilizes basic asynchrony with setInterval(), testing with Jasmine (specifically Jasmine Clock), and ES6 features. The lesson/project should specifically teach students the following:
- how to use setInterval()
- using arrow notation with a nested function (in this case, setInterval()) so
this
keyword is lexically scoped - using Jasmine Clock to test the passage of time in JavaScript
beforeEach()
andafterEach()
Jasmine helpers are also utilized- other ES6 functionality such as classes and modules