learn-co-curriculum / javascript-fix-this

Other
0 stars 1 forks source link

JavaScript Fix this

Overview

In this lab, you'll use this, change a function's context, and write modular code.

Introduction

In this lab, we're going to put your knowledge of this, call, apply, and bind to the test while we make some tasty treats in a virtual bakery.

You'll have to fix some problems with the existing code (there may be some bugs!) and add some new code of your own to get the tests passing and get those desserts made!

cake make

Instructions

We want to get our bakery up and running, but there are problems with making sure that the right things are getting baked the right way.

If you run index.html in your browser and click either of the "make" links, it should go through all the right steps to make the right dessert, and update the status for each step as it goes.

Right now, all our baking functions are mixed up and can't figure out their this. We've got some work to do before we can open our bakery.

REMEMBER, as you code, you can run mocha.run() in the console to see how the tests look. Simply refresh the page to try again.

Each step of the way, you should be using what you know about call, bind, and apply to make each function set the context for the next function.

Resources