GithubHelp home page GithubHelp logo

ultimatecourses / javascript-basics Goto Github PK

View Code? Open in Web Editor NEW
83.0 8.0 104.0 802 KB

๐Ÿ† Starter project for JavaScript Basics

Home Page: https://ultimatecourses.com/learn/javascript-basics

CSS 51.82% HTML 10.93% JavaScript 37.25%

javascript-basics's Issues

ESlint breaks build when using console.log

Hello, thanks for this course!!

Doing the course I found a problem when I tried to used console.log:

11:5 error Unexpected console statement no-console
13:5 error Unexpected console statement no-console

Someone help me out with this problem and explained to me that the issue was caused by the library ESlint, specifically, the rule no-console that comes with "eslint:recommended" rules.

I don't know if this is intended, but it prevents working with the examples and see the results in the console.

thanks :)

Incorrect code: chapter "Arrays In-Depth", lesson "Adding Array Elements"

The code shown in the explanation video is not in fact immutable.

Incorrect code:

console.log([
  ...drinks.splice(0, index),
  'Mojito',
  ...drinks.splice(index - 1),// side note: the -1 index correction is only needed as a result of the first splice mutating the original array
]);

Correct code:

console.log([
  ...[...drinks].splice(0, index),
  'Mojito',
  ...[...drinks].splice(index),
]);

Explanation:
As splice mutates the original array, before the spread operator spreads it, the original array gets mutated nevertheless. Solution: copy original array with spread operator, splice it, then spread the result.

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.