21/04/2020
@metaluca_dev
javascript = Netscape()
}
return ECMA_International.tc39( javascript )
ECMAScript was always an unwanted trade name that sounds like a skin disease.
#0 - strawman
#1 - proposal
#2 - draft
#3 - candidate
#4 - finished
var regex = /t(e)(st(\d?))/g;
var string = 'test1test2';
string.match(regex); // gives ['test1', 'test2'] - how do i get the capturing groups?
var matches = [];
var lastIndexes = {};
var match;
lastIndexes[regex.lastIndex] = true;
while (match = regex.exec(string)) {
lastIndexes[regex.lastIndex] = true;
matches.push(match); // example: ['test1', 'e', 'st1', '1'] with properties `index` and `input`
}
matches; /* gives exactly what i want, but uses a loop, and mutates the regex's `lastIndex` property */
lastIndexes; /* ideally should give { 0: true } but instead will have a value for each mutation of lastIndex */
var matches = [];
string.replace(regex, function () {
var match = Array.prototype.slice.call(arguments, 0, -2);
match.input = arguments[arguments.length - 1];
match.index = arguments[arguments.length - 2];
matches.push(match);
// example: ['test1', 'e', 'st1', '1'] with properties `index` and `input`
});
matches; /* gives exactly what i want, but abuses `replace`, mutates the regex's `lastIndex` property,
* and requires manual construction of `match` */
const main = document.querySelector("main");
for (const link of document.querySelectorAll("nav > a")) {
link.addEventListener("click", e => {
e.preventDefault();
import(`./section-modules/${link.dataset.entryModule}.js`)
.then(module => {
module.loadPageInto(main);
})
.catch(err => {
main.textContent = err.message;
});
});
}
// BigInt >> pow(2, 53) - 1
const withPostfix = 9007199254740991n
// 9007199254740991n
const withBigInt = BigInt(9007199254740991)
// 9007199254740991n
const withBigIntString = BigInt('9007199254740991')
// 9007199254740991n
// BigInt >> pow(2, 53) - 1
const withPostfix = 9007199254740991n
// 9007199254740991n
const withBigInt = BigInt(9007199254740991)
// 9007199254740991n
const withBigIntString = BigInt('9007199254740991')
// 9007199254740991n