Search results

The range: {3,5}, match 3-5 times To find numbers from 3 to 5 digits we can put the limits into curly… Then a regexp \d{3,} looks for sequences of digits of length 3 or more:… r finds both color and colour:
Here the switch starts to compare a from the first case variant that is 3.… Here the execution of case 3 starts from the line (*) and goes through case 5, because there’s no break… But for 3, the result of the prompt is a string "3", which is not strictly equal === to the… number 3.… So we’ve got a dead code in case 3! The default variant will execute.
Otherwise, if the first digit is 2, then the next must be [0-3].… other first digit is allowed) We can write both variants in a regexp using alternation: [01]\d|2[0-3]… If we glue hours and minutes together, we get the pattern: [01]\d|2[0-3]:[0-5]\d.… The alternation | now happens to be between [01]\d and 2[0-3]:[0-5]\d.… Let’s correct that by enclosing “hours” into parentheses: ([01]\d|2[0-3]):[0-5]\d.
There may be 2, 3, 4 or more.… In the demo above they are labeled: 1, 2, 3. Build segments between control points 1 → 2 → 3.… 3 → 4.… There will be 3 brown segments.… + t2P3 For 4 control points: P = (1−t)3P1 + 3(1−t)2tP2 +3(1−t)t2P3 + t3P4 These are vector equations
Let’s see what happens during the pow(2, 3) call. pow(2, 3).In the beginning of the call pow(2, 3) the… We can sketch it as: Context: { x: 2, n: 3, at line 1 } pow(2, 3) That’s when the function… Then the previous context is restored: Context: { x: 2, n: 3, at line 5 } pow(2, 3) When… it finishes, we have a result of pow(2, 3) = 8.… The recursion depth in this case was: 3.
Math.round Rounds to the nearest integer: 3.1 becomes 3, 3.6 becomes 4.… In the middle cases 3.5 rounds up to 4, and -3.5 rounds up to -3.… 4 3 3 3.5 3 4 4 3 3.6 3 4 4 3 -1.1 -2 -1 -1 -1 -1.5 -2 -1 -1 -1 -1.6 -2 -1 -2 -1 These functions… Compare it to one-third: 1/3. It becomes an endless fraction 0.33333(3).… So, division by powers 10 is guaranteed to work well in the decimal system, but division by 3 is not.
As we can see, there are 2 matches instead of 3.… That’s because there’s no newline after 3 (there’s text end though, so it matches $).
Let’s say we have 3 nested elements FORM > DIV > P with a handler on each of them:… So if we click on <p>, then we’ll see 3 alerts: p → div → form.… The standard DOM Events describes 3 phases of event propagation: Capturing phase – the event goes down… Note that while formally there are 3 phases, the 2nd phase (“target phase”: the event reached the element… one that has the handler on it) event.eventPhase – the current phase (capturing=1, target=2, bubbling=3)
For instance, the loop below outputs i while i < 3:… The loop below runs alert(i) for i from 0 up to (but not including) 3:… condition i < 3 Checked before every loop iteration. If false, the loop stops.… This makes the loop identical to while (i < 3)… Summary.We covered 3 types of loops: while – The condition is checked before each iteration. do..while
the example above, the result of expression (a = b + 1) is the value which was assigned to a (that is 3)… Then, 3 + 4 is evaluated and returned as the result.… Without them: a = 1 + 2, 3 + 4 evaluates + first, summing the numbers into a = 3, 7, then the assignment… operator = assigns a = 3, and the rest is ignored.… It’s like (a = 1 + 2), 3 + 4.
To do the request, we need 3 steps: Create XMLHttpRequest:… An XMLHttpRequest object travels them in the order 0 → 1 → 2 → 3… → … → 3 → 4.… State 3 repeats every time a data packet is received over the network.… There are 3 methods for HTTP-headers: setRequestHeader(name, value) Sets the request header with the
Then in result[2] goes the group from the second opening paren ([a-z]+) – tag name, then in result[3]… The array has the length of 3,… The array length is permanent: 3.… Just like match, it looks for matches, but there are 3 differences: It returns not an array, but an
The element was removed, but the array still has 3… elements, we can see that arr.length == 3.… In the next example, we remove 3 elements and replace them with the other two:… On the 3rd run, sum = 3 and we add one more element to it, and so on… The calculation flow:… the third call 3 3 6 the fourth call 6 4 10 the fifth call 10 5 15 Here we can clearly see how
For instance, the Promise.all below settles after 3 seconds, and then its result is an array [1, 2, 3… For instance, here the results are [1, 2, 3]:
It has 3 modes: If the regexp doesn’t have flag g, then it returns the first match as an array with… There are 3 differences from match: It returns an iterable object with matches instead of an array.… If there are no parentheses in the regexp, then there are only 3 arguments: func(str, offset, input).
read about new bleeding-edge features, including those that are “almost standard” (so-called “stage 3
For instance, when we create an array [1, 2, 3], the default new Array() constructor is used internally… Here’s the overall picture (for 3 built-ins to fit): Let’s check
Sets.For instance, [eao] means any of the 3 characters: 'a', 'e', or 'o'. That’s called a set.… 𝒳𝒴] – are not two, but four characters: left half of 𝒳 (1), right half of 𝒳 (2), left half of 𝒴 (3)
Similar to that, \2 would mean the contents of the second group, \3 – the 3rd group, and so on.
Here it checks that the result of pow(2, 3) equals 8.… Go to 3, update the implementation till tests give no errors.… Repeat steps 3-6 till the functionality is ready. So, the development is iterative.… Let’s add one more test to check that pow(3, 4) = 81.
But of course in the result only the first two will be counted, so the result in the code above is 3.… Now let’s say we have an array [3,
code above: We load 1.js, then if there’s no error… We load 2.js, then if there’s no error… We load 3.… loadScript('3.js', function(error, script) { if (error) { handleError(error);
We’ll talk about let/const variables here In JavaScript, there are 3 ways to declare a variable… Step 3.… If we call counter() multiple times, the count variable will be increased to 2, 3… In the code below, all 3 of them: A
That’s why (3) null >= 0 is true and (1) null > 0 is false.… The equality check (3) returns false because undefined only equals null, undefined, and no other value
Note that \n is a single “special” character, so the length is indeed 3.… Getting a substring.There are 3… There are 3 types of quotes.
the current user database has a higher version than in the open call, e.g. the existing DB version is 3,… from 3 to 4 etc.… (e.g. old 2, now 4) and run per-version upgrades step by step, for every intermediate version (2 to 3,… then 3 to 4).… Perform the request to the object store books.add(book), at (3).
Iteration over Map.For looping over a map, there are 3… The callback function passed in forEach has 3 arguments: a value, then the same value valueAgain, and
Left button (primary) 0 Middle button (auxiliary) 1 Right button (secondary) 2 X1 button (back) 3… possible values: event.which == 1 – left button, event.which == 2 – middle button, event.which == 3
Here’s what should show up: The Sources panel has 3 parts: The… For example, here 1+2 results in 3, while the function call hello("debugger") returns nothing
To send a file, 3-argument syntax is needed, the last argument is a file name, that normally is taken
As we can see, regexp /\w+/y doesn’t match at position 3
Still, it’s important to know about all 3 hints, soon we’ll see why.… There are 3 types (hints) of it: "string" (for alert and other operations that need a string
We should see it from done:true and process value:3 as the final result.… It doesn’t show 3! It’s because for..of iteration ignores the last value, when done: true.
There are 3 possible values: "loading" – the document is loading.… The typical output: [1] initial readyState:loading [2] readyState:interactive [2] DOMContentLoaded [3]
For instance, the CSS below animates changes of background-color for 3 seconds:… Now if an element has .animated class, any change of background-color is animated during 3… In more technical details, when there’s a style change, the browser goes through 3 steps to render the
see that it’s just an ordinary sequence of tests: The first question mark checks whether age < 3.
Also, there are tools like JSDoc 3 that can generate HTML-documentation from the comments.
They both call func with arguments 1, 2 and 3.… Here we use a simple “joining” function that turns arguments (3, 5) into the key "3,5".
;p> first child (taking all but two first letters of "Example: ") ends at the position 3… endOffset – node and offset of the end, in the example above: first text node inside <b> and 3.… Here’s a screenshot of a selection with 3 ranges, made in Firefox:
select and option.A <select> element has 3 important properties: select.options – the collection
It has 3 working modes: If the regular expression has flag g, it returns an array of all matches:
Events Level 2 specification is supported in all major browsers, while the newer Pointer Events Level 3… Also there are 3 additional pointer events that don’t have a corresponding mouse... counterpart, we’ll
It’s funny that in our situation normalize() actually brings together a sequence of 3 characters to one
Full example.Here’s the server that sends messages with 1, 2, 3,
It has a numeric value: elem.nodeType == 1 for element nodes, elem.nodeType == 3 for text nodes, elem.nodeType… It has a numeric value: 1 for elements,3 for text nodes, and a few others for other node types.
The header may have 3 values: DENY Never ever show the page inside a frame.
Only first 50 results are shown.