Modern JavaScript Tutorial
Other
19966
336
3472

In the lesson titled Nullish coalescing operator '??', in the Comparison with II section, located here, there is a minor mistake in the grammar.

"Historically, the OR || operator was there first. It exists since the beginning of JavaScript, so developers were using it for such purposes for a long time."

Should become something like

"Historically, the OR || operator was there first. It's existed since the beginning of JavaScript, so developers were using it for such purposes for a long time."

or

"Historically, the OR || operator was there first. It's been there since the beginning of JavaScript, so developers were using it for such purposes for a long time."

Thank you for these excellent lessons. This is my first attempt to contribute something to a project via Github, I hope it's formatted properly.

Hello,
I´m interested in becoming a maintainer for a translation to Portuguese, at https://javascript.info.
GitHub Nick = Leopoldo V Fonseca
(https://github.com/leopoldovcfonseca)

Thanks for creating this wonderful tutorial. I've enjoyed it so far and I continue to learn about JS.

Who are you?

  • Recently, I got interested in the arts of editing (specifically plain language). I am not a professional editor.
  • I am a native English speaker from the UK. I am looking to sharpen my skills, not bragging.
  • As I read the tutorial, I notice that certain words/phrases can be revised to sound better (in my opinion).
  • I forked this project and created a plain-language branch.
  • If you're a professional editor, I hope you can work with me to be more conscious on my editing efforts.

What are you trying to do?

  1. Cut out the extraneous words, more focused content.
  2. Improve structure and readability
  3. Ultimately save time for both the author and the reader

What did you spot?

  • 'such' as in 'such a course' -> 'this course' ('such' sounds too formal given the overall tone of the course.)
  • 'there exists a function' -> 'there is a function' (same thing, 'there exists' sounds formal or non-native)
  • 'We can implement a string' -> 'We can use a string' ('implement' is not a big issue, it's down to what the author prefers. Stick with plain language or not?)

Reference material (note to self): https://www.plainlanguage.gov/resources/checklists/web-checklist/

Question from me (solved below)
Before I put more effort into this, I want to know if this project is actively maintained. I see lots of old PRs and issues, so I'm not sure if it's worth my time to suggest edits.

Ideas for the future
Perhaps a style guide needs creating in future, I see conflicting things like 'we' vs 'you'. Sometimes 'such that' is used, sometimes it's not. I also noticed there is no specific contribution guide (what to do and what not to do).

UPDATE: I found AUTHORING.md which fits this purpose.

Some programming languages allow to use negative indexes for the same purpose, like fruits[-1].

should be:

Some programming languages allow "us" to use negative indexes for the same purpose, like fruits[-1].

Hey! I'd like to point out that the "Get coordinates using button.getBoundingClientRect() for this button" button is making this page have a horizontal sidebar on mobile devices.

This isn't ideal since this is the only element that overflows the maximum width of mobile devices display.

What I'd suggest is resizing this button for mobile users, such that the button would fit the page. This can be achieved through CSS, setting up a maximum width of the button on mobile screens, the text will overflow to the next line.

Cya

Issue

Hi,
I just found a bug on the main page (i checked it on brave and chrome, opera), it turns out that the top bar displaying the user's position on the page does not cover all the text underneath and you can see some text on top of it. I don't know what causes it, because top property is set to 0.
Gif:
Animation

Solution

I know how to fix this issue, just set the value of the "top" property of the "tabs__menu sticky" element to -0.1px to avoid the problem.
Gif:
after

Regarding 1-js/09-classes/06-instanceof, now Edge/Chrome browsers don't like this syntax anymore, and throws Uncaught SyntaxError: Unexpected token '.'

Now we have to write ({}).toString(). In Node.js {}.toString() still works. Was there a change in the spec recently or it's actually a bug in brower?

Current: Modern build tools, such as webpack and others, bundle modules together and optimize them to speedup loading. They also removed unused imports.
Expected: Modern build tools, such as webpack and others, bundle modules together and optimize them to speedup loading. They also remove unused imports.

Current: For instance, if you import * as library from a huge code library, and then use only few methods, then unused ones will not be included into the optimzed bundle.
Expected: For instance, if you import * as library from a huge code library, and then use only few methods, then unused ones will not be included into the optimized bundle.

Language Code: tl

For maintainer, I'm only one, but I will try to get some help from other Filipino programmers and developers. Another problem is that I'm a student and new to learning JavaScript. Is it okay?

GitHub Username: diamant3
Email: diamant3@zohomail.com

If I execute the Function in if exercise I get Hello, John, and that was the solution I expected as well.

However, in your solution I read:

The result is an error.
The function sayHi is declared inside the if, so it only lives inside it. There is no sayHi outside.

Your solution is wrong, please fix it.

Ilya,
I would appreciate it if you could explain how to call, from a browser, JS functions with several parameters, in such a way that we can also capture the event object.
Thank you for your trouble, and best regards,
Eric

Hello!

Not sure if requests fit here, but would it possible to expand the explanations to explain what CSRF cookies are and how they work? There is an explanation on CORS so I would propose to have it next to one another.

  1. hovering over 'read this before commenting…' displays a popup with some useful links, but moving the cursor to the popup to attempt to follow a link causes the popup to disappear...making the links useless. Well, it is possible if you carefully move the cursor over the little 'triangle' part of the popup...
  2. the 'https://javascript.info/try-catch' discussion doesn't comment on its use with async/await, and it's a major use-case since it's the alternative of Promise's 'catch'. Also, this important_warn suggests try/catch isn't going to work with async/await, but that's isn't the case...
  3. 'name' on anchor elements is deprecated (in favour of 'id'), and the document could use some more 'id's on other parts, like the above 'important_warn'?

I found this repo contains lots of JavaScript articles write in markdown format. Could we use some static generators like gatsby, hexo, vuepress listed in https://jamstack.org/generators/ to build static htmls and use them locally?

Part 3 (Additional articles)
Chapter 7 (Regular expressions)
Article 14 (Lookahead and lookbehind)

Why you don't mention that in JS non fixed length regexps (including quantifiers, backreferences etc.) are not allowed inside lookbehind expression ?

First you talk about lookahead, and using regexp with quantifier as lookahead condition in your example.

Copied from www.javascript.info
For example, \d+(?=\s)(?=.*30) looks for \d+ that is followed by a space (?=\s), and there’s 30 somewhere after it (?=.\*30)

Right after this you briefly talk about lookbehind and say it is the same thing but looks behind, without mentioning that it actually cannot do the same thing with non fixed lenght regular expressions (including quantifiers like *).

The first task of the variables page suggest to declare and use two variables :
admin and name.

Using name as the name of the variable can be confusing and code editors will show a warning: 'name' is deprecated.ts(6385)
lib.dom.d.ts(17693, 5): The declaration was marked as deprecated here. (VSCode)

name variable should be renamed

Would suggest to change the following sentence Arrays in accordance with Deque Complexity.
For instance, the MDN doc on arrays Array MDN doesn't mention that js arrays are deques.

There's a note on Private and protected properties and methods stating that the private keyword in classes isn't supported by any javascript engines and that usage requires polyfilling. But according to caniuse, the private keyword has been supported by all major browsers for almost 3 years.