Rignchen / ex-js-empty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript exercises

Some basic exercises to discover JS.

Setup

Install node.js on your system, you need node 20 ! You can use nodesource builds to install node v20.

# clone the repository or download the exercises
# Move into the repository
cd ex-js
# Install dependencies
npm i
# Install playwright browser for e2e tests
npx playwright install

Simple syntax exercises

Launch the tests by typing npm run test, this will launch all tests, and rerun tests at each file change. You can also launch test from your IDE. You can browse tests, they are located in files ending with .test.js.

  1. Basic conditions
  2. Manipulating strings
  3. Maths
  4. Arrays
  5. Objects

Interacting with browser and dom exercises

First you need to launch de dev server npm run dev, to see your results in the browser. The dev server must be started for the tests to execute correctly. Launch the tests by typing npx playwright test, if you encounter difficulties, you can run the tests in ui mode, to see wich test fails : npx playwright test --ui.

  1. Dom basics
  2. Click events
  3. Input events
  4. Mouse and focus events
  5. Fetch data

About


Languages

Language:JavaScript 94.7%Language:HTML 5.3%