\S
Non-space: any character except \s, for instance a letter.… That’s what flag s does.… The pattern [\s\S] literally says: “a space character OR not a space character”.… S] or alike.… \s – space symbols, tabs, newlines.
\S – all but \s.
\w – Latin letters, digits, underscore '_'.
An obvious way to construct a regexp would be to take a word followed by an optional space \w+\s?… That leads us to the regexp ^(\w+\s?)… , but the regular expression expects a wordly character \w or a space \s at the end.… It tries all combinations of how the regexp (\w+\s?)… spaces \s?
For instance, if we have S followed by the special “dot above” character (code \u0307), it is shown as… Ṡ.… For instance, if we append a character “dot below” (code \u0323), then we’ll have “S with dots above… and below”: Ṩ.… The reason is that the symbol Ṩ is “common enough”, so Unicode creators included it in the main table
Don’t forget the "s&… Novice developers sometimes forget the letter "s".… The "s" letter is absent in getElementById, because it returns a single element.… But getElementsByTagName returns a collection of elements, so there’s "s" inside.… getElementsByClassName
class
✔
✔
By far the most used are querySelector and querySelectorAll, but getElement(s)
[\s\d] means “a space character or a digit”.… character sets
For instance:
\d – is the same as [0-9],
\w – is the same as [a-zA-Z0-9_],
\s… [^\s] – any non-space character, same as \S.
But promises are more convenient, so it makes sense to promisify them.… In practice we may need to promisify more than one function, so it makes sense to use a helper.
=\s)(?=.*30) looks for \d+ that is followed by a space (?=\s), and there’s 30 somewhere after it (?
returned.
m
Multiline mode (covered in the chapter Multiline mode of anchors ^ $, flag "m").
s… A regular expression consists of a pattern and optional flags: g, i, m, u, s, y.
…But still allows use of any top-level HTML tags, even those that don’t make sense without proper wrappers
typical code, many objects have a short life span: they appear, do their job and die fast, so it makes sense… If you are familiar with low-level programming, more detailed information about V8’s garbage collector
This attribute no longer makes sense because JavaScript is the default language.
So it makes sense to check event.code, it’s always the same.… The browser opens the “Save Page” dialog (Ctrl+S)
…and so on.
Symbol S:
currency Sc,
modifier Sk,
math Sm,
other So.
end
The rest parameters gather all remaining arguments, so the following does not make sense
These two are a “sweet couple”: they equal each other (in the sense of ==), but not any other value.
So if we want to support combinations like Ctrl+click, then for Mac it makes sense to use Cmd+click.
Split into letters
The call to split(s)… with an empty s would split the string into an array of letters:
Surely, a function is a special value, in the sense that we can call it like sayHi().
They are in a sense more widespread than private ones, because we usually want inheriting classes to
In particular, there’s no sense in returning true.
In most scenarios, it’s not important at all, sometimes, for security purposes, it makes sense to remove
Of course they are not numbers in the common sense of this word.
New calls to generator.next() don’t make sense any more.
Alternative default parameters.Sometimes it makes sense
The call .finally(f) is similar to .then(f, f) in the sense that f runs always, when the promise is settled
Modules work only via HTTP(s), not locally
If you try to open a web-page locally, via file
If the server expects other methods and headers in the future, it makes sense to allow them in advance
The time should be in CSS time format: in seconds s or milliseconds ms.
transition-delay.In transition-delay