Giter VIP home page Giter VIP logo

js-array-challenge's Introduction

JS-Array-Challenge

자바스크립트 배열을 마스터 해보자!

문제 풀기

  • (처음 clone받으면) npm install 을 한다.
  1. Problems에서 풀고 싶은 문제를 Challenge 폴더 본인 깃헙 아이디 폴더를 만들어 복붙한다.
  2. 문제의 README.md로 문제를 파악한다.
  3. solve.js에서 문제를 해결하는 함수를 작성한다.
  4. 문제 푼 폴더에서 jest 명령어 실행 후 통과해면 성공!

문제 만들기

  1. Problems폴더에 문제 제목으로 폴더를 만든다
  2. README.md 파일에 문제 설명을 적는다
ex)

## 설명

every를 이용해서 모든 원소가 짝수인지 아닌지를 판별하세요
  1. solve.js를 아래와 같이 작성한다.
function solution(inputArray) {}

exports.solution = solution;
  1. solve.test.js 에 테스트 케이스를 추가한다.
const { solution } = require('./solve');

const test1 = {
  input: [2, 4, 6, 8, 10],
  answer: true,
};

const test2 = {
  input: [2, 3, 6, 8, 10],
  answer: false,
};

describe('everyArray', () => {
  test('모두 짝수면 true여야 한다.', () => {
    expect(solution(test1.input)).toEqual(test1.answer);
  });

  test('홀수가 있으면 false여야 한다.', () => {
    expect(solution(test2.input)).toEqual(test2.answer);
  });
});
;

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.