Skip to content

be-hacking-hyf/javascript-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HackYourFuture Belgium

JavaScript 2!

In JS 1 you learned to work on some pretty tricky problems by writing single functions that process user input.

In JS 2 you will learn about how to build simple websites by organizing your functions into objects that save and modify user data. In other words, Object Oriented Programming.

check the wiki for class materials an supporting resources


Module Exercises

No module exercises for JS 2! All exercises are alongside the projects they best support.


Weekly Projects

How can you organize your code around user data?

The projects in this module will introduce you to Object Oriented Programming, a way of organizing the functions you write around the data they need.

Test Driven Development:

Without knowing it, you have already been practicing Test Driven Development. The philosophy behind TDD is that you write tests to describe what your code should do before writing the code. All through JS 1 you have been writing functions to pass the tests we provided using the evaluate function. This is TDD! In the JS 2 projects you will be introduced to professional TDD tools: Mocha & Assert.

The Weekly Projects all have 3 pieces:

app.js

This app object is the core of your application. It will store data in an array or object, and implement user stories with methods (functions inside your object).

You will be provided with starter code for your object and tests describing what it should do. Don't be intimidated by all of the red when you first open the projects in your browser! As long as you approach the app.js object one method at a time without being overwhelmed by the entire thing, you will find that each method is not too difficult.

Practice Problems

To help build the skills necessary to pass your app.js tests, the practice-problems folder contains exercises that ask you to solve similar problems (but with functions instead of objects), and exercises that introduce some of the JS language features needed to complete your object. You are required to finish every exercise every week, they are there to help you understand the project and to take you further if you're looking for more.

Getting started

  • Navigate to the a week directory (e.g. week-1-project) in your document explorer.
  • Navigate to the practice-problem sub directory.
  • Open the index.html page in your browser.

Each header represents a collection of exercises.
Every collection has a corresponding .js file that you can find in the /week-x-project/practice-problems directory. The collection consist of a list of exercises. Each exercise has a color that indicates the type and result of the exercise.

black read through the code in the corresponding function located in the .js file and make sure you understand.

red the function threw at least one error.

orange the function did not pass at least one test case or console.assert.

green all problems in this function have been solved.

purple one or more of the test cases are invalid (missing name, args not an array, ...)

  • Open the .js file in your code editor.
  • Solve and read through the problems.
  • When you solved a problem be sure to save .js file and refresh index.html in your browser to view the result.

You'll know you've completed the exercises when every line in your browser is green. (except the examples, they can stay black)

User Interface

In the user-interface folder you will find, well, a user interface for your object. A very important skill to learn as a developer is being able to look at a web page and imagine code that could make it work. To help you build this intuition the user interfaces in this module may not be very pretty, but they are transparent. The inputs, buttons, and outputs describe what they are making happen behind the scenes so you can practice seeing web pages like a developer: not only as a user experience, but as a software application!



Releases

No releases published

Packages

 
 
 

Contributors