Git Product home page Git Product logo

week1-web's Introduction

Week 1

As a part of this assignment, you would have to complete some simple javascript functions present in the src directory!

To run the project:

  1. Fork and clone the repository.
  2. Install NodeJS on your system.
  3. Run npm i.
  4. Solve the tasks!
  5. You can view your progress by running the command npm run test and then viewing the file test.html!
  6. When done, push the same to GitHub and create a Pull Request to submit your work.

How to implement assignments

Task modules are located in the src folder. Each module consists of several tasks (functions you need to complete) for specified topic. Each task/fucntion looks mostly like the following:

/**
 * Returns the result of concatenation of two strings.
 *
 * @param {string} value1
 * @param {string} value2
 * @return {string}
 *
 * @example
 *   'aa', 'bb' => 'aabb'
 *   'aa',''    => 'aa'
 *   '',  'bb'  => 'bb'
 */
function concatenateStrings(value1, value2) {
	throw new Error("Not implemented");
}
  • Read the task description in the comment above the function. Try to understand the idea. The comments clearly document what the inputs to the function are, and what should it's return value be.
  • Remove the throwing error line from function body
throw new Error("Not implemented");

and run the unit tests again using npm run test.

  • Find the test corresponding to the function in the automatically opened Test Results page. You can see the points associated with the particular test on the webpage.

  • Clicking on the header corresponging to the test would also give you additonal information about the failing cases!

    Test Information Example

    For example, in this screenshot, we can see that the findElement function is failing on the call findElement(["Array", "Number", "string"], "Date") as the same is returning the value 1, while the value -1 was expected!

  • Implement the function using your JS knowledge and verify your solution by running tests until the failed test passes (becomes green).

  • Even after your solution passes, try to refactor it! Try to make your code as pretty and simple as possible keeping the tests green!

  • You can see your total score in the tests in the command line where you ran the npm run test command. You can include a screenshot of the same while submitting the pull request.

Evaluation

You need to obtain atleast 70% score in this assignment and then create a PR to complete this week.

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.