• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

DevMountain/javascript-1-afternoon: An afternoon project to help students solidi ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

DevMountain/javascript-1-afternoon

开源软件地址:

https://github.com/DevMountain/javascript-1-afternoon

开源编程语言:

JavaScript 98.7%

开源软件介绍:

Project Summary

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

Setup

  • Fork this repository.
  • Clone your fork.
  • 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!

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. Another great tool for small and isolated pieces of code is Python Tutor. Just make sure to change the code to JavaScript ES6.

Resources

Variables
Data Types
Arrays
// declare an empty array
let myThings = [];

// declare an array with items
let myThings = ['Bike', 7, {name: 'Jeff'}, ['Catfish']]
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
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
Let

Contributions

If you see a problem or a typo, please fork, make the necessary changes, and create a pull request so we can review your changes and merge them into the master repo and branch.

Copyright

© DevMountain LLC, 2017. Unauthorized use and/or duplication of this material without express and written permission from DevMountain, LLC is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to DevMountain with appropriate and specific direction to the original content.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap