GithubHelp home page GithubHelp logo

jeffreymolleno / javascript-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boomcamp/javascript-1

0.0 1.0 0.0 68 KB

Practice javascript basics like function and variable declaration

HTML 0.66% JavaScript 99.34%

javascript-1's Introduction

Project Summary


In this project, we'll provide practice JavaScript problems to help you better understand the fundamentals.

Project Setup


  • Fork this repository.
  • Clone your fork onto your local machine.
  • Create a new git branch named submission.
  • Open ./user.json and fill in your details.
  • Open ./practice.js with your code editor.
  • Open ./index.html with your browser.

Directions

Complete all the activities inside of ./practice.js to make the spec runner pass it's tests. In order to check the progress of the spec runner, open ./SpecRunner.html with your browser. Remember to commit and push your code often. Good luck!

Finished

Open a pull request from your submission branch back to the master branch of this repository.

Tips and Tricks

One of the biggest tools at the developer's disposal is the browser's built-in debugger. To use it, open ./index.html with your browser and open the browser developer tools.

Resources

  • Variables

  • Data Types

  • Arrays

    // declare an empty Array
    let stuff = [];
    
    // declare an Array with items
    let things = ['Name', 8, { firstName: 'Aodhan', ['Hello'] }]
  • Objects

    // declare an empty object
    let car = {}
    
    // declare an object with properties
    let car = {
      make: 'Ford',
      model: 'GT',
      year: 2019
    }
    
    // adding or updating properties with dot notation
    car.miles = 100;
    
    // adding or updating properties with bracket notation
    // if miles already exists on the object, this would change it's value
    // if it doesn't this will set it as a key with a value of 150
    car['miles'] = 150
    
    // if a property doesn't exist on an object, it's considered undefined
    
    car.owner === undefined // true
  • Control Flow / Conditionals

  • Functions

    // Function Declaration
    
    function doTheThing() {
      return 'Did the thing';
    }
    
    // Function Expression
    
    let doTheThing = function() {
      return 'Did the thing';
    }
    
    // Function Parameters, Arguments and Invoking (calling) a Function
    // name is a function parameter
    // a variable we'll use in our function body
    
    function sayMyName(name) {
    
    // the string 'Your name is Jeff' will be output
    // from this function because of the return keyword
    
      return 'Your name is ' + name;
    }
    
    // function invocation
    // parentheses after the function tell the function to run
    // The string Jeff is called an argument (a value passed to a function and received as a parameter)
    sayMyName('Jeff');
    
    // Here we're passing more arguments than there are parameters
    // Only Jeff will be received as "name" in the parameter list
    sayMyName('Jeff', 'Karen')
  • Scope

javascript-1's People

Contributors

aodhanhayter avatar

Watchers

James Cloos 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.