GithubHelp home page GithubHelp logo

javascript-fix-the-scope-lab-dc-instructors-new-mod-3's Introduction

JavaScript Fix the Scope Lab

Objectives

  • Explore scope in JavaScript
  • Exercise bug-finding skills related to scope issues

Instructions

In this lab, you'll need to debug some issues related to function scope in JavaScript: variables might not be what we expect, certain variables might be unavailable, and in general havoc might be set loose in the current code.

As usual, start by running the specs and reading the results. Then fix some things, run the tests again, and repeat.

You're probably pretty good at this right now โ€” good luck!

A Hint About ()

Remember the purpose of using () is to call functions in JavaScript. It essentially tells our code to execute the function. A function called without a (), like simply functionName, will return the function but NOT run it. You'll see the return value as [Function: functionName].

To get our code to execute that function, we instead call functionName(), which executes the code within that function.

As an example, the third test here at first returns: Error: Expected [Function: funkyFunction] to equal 'FUNKY!'

We can make the function execute by saying this: var theFunk = funkyFunction() But this returns ANOTHER FUNCTION! How would we tell that function to execute to return the string within it?

Resources

View Fix The Scope Lab on Learn.co and start learning to code for free.

javascript-fix-the-scope-lab-dc-instructors-new-mod-3's People

Contributors

alpha-convert avatar annjohn avatar bhollan avatar dakotalmartinez avatar gj avatar pletcher avatar sheaniqua avatar thelucasmoore avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.