-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrea MariaDB
authored
Jun 12, 2021
1 parent
e9db3d2
commit 5fbc5fc
Showing
94 changed files
with
780 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"records": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ViewState] | ||
Mode= | ||
Vid= | ||
FolderType=Generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"fileName": "sharedarraybuffer-bytelength.js", | ||
"title": "JavaScript: SharedArrayBuffer.byteLength", | ||
"type": "js" | ||
}, | ||
{ | ||
"fileName": "sharedarraybuffer-constructor.js", | ||
"title": "JavaScript: SharedArrayBuffer Constructor", | ||
"type": "js" | ||
}, | ||
{ | ||
"fileName": "sharedarraybuffer-slice.js", | ||
"title": "JavaScript: SharedArrayBuffer.slice()", | ||
"type": "js" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var sentence = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
var index = 4; | ||
|
||
console.log('The character at index ' + index + ' is ' + sentence.charAt(index)); | ||
// expected output: "The character at index 4 is q" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var sentence = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
var index = 4; | ||
|
||
console.log('The character code ' + sentence.charCodeAt(index) + ' is equal to ' + sentence.charAt(index)); | ||
// expected output: "The character code 113 is equal to q" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var icons = '☃★♲'; | ||
|
||
console.log(icons.codePointAt(1)); | ||
// expected output: "9733" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var str1 = 'Hello'; | ||
var str2 = 'World'; | ||
|
||
console.log(str1.concat(' ', str2)); | ||
// expected output: "Hello World" | ||
|
||
console.log(str2.concat(', ', str1)); | ||
// expected output: "World, Hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const str1 = 'Cats are the best!'; | ||
|
||
console.log(str1.endsWith('best', 17)); | ||
// expected output: true | ||
|
||
const str2 = 'Is this a question'; | ||
|
||
console.log(str2.endsWith('?')); | ||
// expected output: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
console.log(String.fromCharCode(189, 43, 190, 61)); | ||
// expected output: "½+¾=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
console.log(String.fromCodePoint(65, 90, 48)); | ||
// expected output: "AZ0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var sentence = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
var word = 'fox'; | ||
|
||
console.log(`The word "${word}" ${sentence.includes(word)? 'is' : 'is not'} in the sentence`); | ||
// expected output: "The word "fox" is in the sentence" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var paragraph = 'The quick brown fox jumps over the lazy dog. If the dog barked, was it really lazy?'; | ||
|
||
var searchTerm = 'dog'; | ||
var indexOfFirst = paragraph.indexOf(searchTerm); | ||
|
||
console.log('The index of the first "' + searchTerm + '" from the beginning is ' + indexOfFirst); | ||
// expected output: "The index of the first "dog" from the beginning is 40" | ||
|
||
console.log('The index of the 2nd "' + searchTerm + '" is ' + paragraph.indexOf(searchTerm, (indexOfFirst + 1))); | ||
// expected output: "The index of the 2nd "dog" is 52" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const str = 'The quick red fox jumped over the lazy dog\'s back.'; | ||
|
||
let iterator = str[Symbol.iterator](); | ||
let theChar = iterator.next(); | ||
|
||
while(!theChar.done && theChar.value !== ' ') { | ||
console.log(theChar.value); | ||
theChar = iterator.next(); | ||
// expected output: "T" | ||
// "h" | ||
// "e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var paragraph = 'The quick brown fox jumps over the lazy dog. If the dog barked, was it really lazy?'; | ||
|
||
var searchTerm = 'dog'; | ||
|
||
console.log('The index of the first "' + searchTerm + '" from the end is ' + paragraph.lastIndexOf(searchTerm)); | ||
// expected output: "The index of the first "dog" from the end is 52" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var str = 'Life, the universe and everything. Answer:'; | ||
|
||
console.log(str + ' ' + str.length); | ||
// expected output: "Life, the universe and everything. Answer: 42" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var a = 'réservé'; // with accents, lowercase | ||
var b = 'RESERVE'; // no accents, uppercase | ||
|
||
console.log(a.localeCompare(b)); | ||
// expected output: 1 | ||
console.log(a.localeCompare(b, 'en', {sensitivity: 'base'})); | ||
// expected output: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var paragraph = 'The quick brown fox jumps over the lazy dog. It barked.'; | ||
var regex = /[A-Z]/g; | ||
var found = paragraph.match(regex); | ||
|
||
console.log(found); | ||
// expected output: Array ["T", "I"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let regexp = /t(e)(st(\d?))/g; | ||
let str = 'test1test2'; | ||
|
||
let array = [...str.matchAll(regexp)]; | ||
|
||
console.log(array[0]); | ||
// expected output: Array ["test1", "e", "st1", "1"] | ||
|
||
console.log(array[1]); | ||
// expected output: Array ["test2", "e", "st2", "2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var first = '\u212B'; // "Å" | ||
var second = '\u0041\u030A'; // "Å" | ||
|
||
console.log(first + ' and ' + second + ' are' + | ||
((first === second)? '': ' not') + ' the same.'); | ||
// expected output: "Å and Å are not the same." | ||
|
||
console.log(first + ' and ' + second + ' can' + | ||
((first.normalize('NFC') === second.normalize('NFC'))? '': ' not') + ' be normalized'); | ||
// expected output: "Å and Å can be normalized" | ||
|
||
var oldWord = 'mañana'; | ||
var newWord = oldWord.normalize('NFD'); | ||
console.log('The word did ' + ((oldWord != newWord)? '' : 'not ') + 'change.'); | ||
// expected output: "The word did change." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const str1 = 'Breaded Mushrooms'; | ||
|
||
console.log(str1.padEnd(25, '.')); | ||
// expected output: "Breaded Mushrooms........" | ||
|
||
const str2 = '200'; | ||
|
||
console.log(str2.padEnd(5)); | ||
// expected output: "200 " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const str1 = '5'; | ||
|
||
console.log(str1.padStart(2, '0')); | ||
// expected output: "05" | ||
|
||
const fullNumber = '2034399002125581'; | ||
const last4Digits = fullNumber.slice(-4); | ||
const maskedNumber = last4Digits.padStart(fullNumber.length, '*'); | ||
|
||
console.log(maskedNumber); | ||
// expected output: "************5581" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Create a variable that uses a Windows | ||
// path without escaping the backslashes: | ||
const filePath = String.raw`C:\Development\profile\aboutme.html`; | ||
|
||
console.log('The file was uploaded from: ' + filePath); | ||
// expected output: "The file was uploaded from: C:\Development\profile\aboutme.html" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?'; | ||
|
||
var regex = /dog/gi; | ||
|
||
console.log(p.replace(regex, 'ferret')); | ||
// expected output: "The quick brown fox jumps over the lazy ferret. If the ferret reacted, was it really lazy?" | ||
|
||
console.log(p.replace('dog', 'monkey')); | ||
// expected output: "The quick brown fox jumps over the lazy monkey. If the dog reacted, was it really lazy?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var paragraph = 'The quick brown fox jumps over the lazy dog. If the dog barked, was it really lazy?'; | ||
|
||
// any character that is not a word character or whitespace | ||
var regex = /[^\w\s]/g; | ||
|
||
console.log(paragraph.search(regex)); | ||
// expected output: 43 | ||
|
||
console.log(paragraph[paragraph.search(regex)]); | ||
// expected output: "." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var str = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
console.log(str.slice(31)); | ||
// expected output: "the lazy dog." | ||
|
||
console.log(str.slice(4, 19)); | ||
// expected output: "quick brown fox" | ||
|
||
console.log(str.slice(-4)); | ||
// expected output: "dog." | ||
|
||
console.log(str.slice(-9, -5)); | ||
// expected output: "lazy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var str = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
var words = str.split(' '); | ||
console.log(words[3]); | ||
// expected output: "fox" | ||
|
||
var chars = str.split(''); | ||
console.log(chars[8]); | ||
// expected output: "k" | ||
|
||
var strCopy = str.split(); | ||
console.log(strCopy); | ||
// expected output: Array ["The quick brown fox jumps over the lazy dog."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const str1 = 'Saturday night plans'; | ||
|
||
console.log(str1.startsWith('Sat')); | ||
// expected output: true | ||
|
||
console.log(str1.startsWith('Sat', 3)); | ||
// expected output: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var str = 'Mozilla'; | ||
|
||
console.log(str.substr(1, 2)); | ||
// expected output: "oz" | ||
|
||
console.log(str.substr(2)); | ||
// expected output: "zilla" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var str = 'Mozilla'; | ||
|
||
console.log(str.substring(1, 3)); | ||
// expected output: "oz" | ||
|
||
console.log(str.substring(2)); | ||
// expected output: "zilla" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var dotted = 'İstanbul'; | ||
|
||
console.log('EN-US: ' + dotted.toLocaleLowerCase('en-US')); | ||
// expected output: "i̇stanbul" | ||
|
||
console.log('TR: ' + dotted.toLocaleLowerCase('tr')); | ||
// expected output: "istanbul" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var city = 'istanbul'; | ||
|
||
console.log(city.toLocaleUpperCase('en-US')); | ||
// expected output: "ISTANBUL" | ||
|
||
console.log(city.toLocaleUpperCase('TR')); | ||
// expected output: "İSTANBUL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var sentence = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
console.log(sentence.toLowerCase()); | ||
// expected output: "the quick brown fox jumps over the lazy dog." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var stringObj = new String("foo"); | ||
|
||
console.log(stringObj); | ||
// expected output: String { "foo" } | ||
|
||
console.log(stringObj.toString()); | ||
// expected output: "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var sentence = 'The quick brown fox jumps over the lazy dog.'; | ||
|
||
console.log(sentence.toUpperCase()); | ||
// expected output: "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var greeting = ' Hello world! '; | ||
|
||
console.log(greeting); | ||
// expected output: " Hello world! "; | ||
|
||
console.log(greeting.trim()); | ||
// expected output: "Hello world!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var greeting = ' Hello world! '; | ||
|
||
console.log(greeting); | ||
// expected output: " Hello world! "; | ||
|
||
console.log(greeting.trimEnd()); | ||
// expected output: " Hello world!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var greeting = ' Hello world! '; | ||
|
||
console.log(greeting); | ||
// expected output: " Hello world! "; | ||
|
||
console.log(greeting.trimStart()); | ||
// expected output: "Hello world! "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var stringObj = new String("foo"); | ||
|
||
console.log(stringObj); | ||
// expected output: String { "foo" } | ||
|
||
console.log(stringObj.valueOf()); | ||
// expected output: "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const symbol1 = Symbol(); | ||
const symbol2 = Symbol(42); | ||
const symbol3 = Symbol('foo'); | ||
|
||
console.log(typeof symbol1); | ||
// expected output: "symbol" | ||
|
||
console.log(symbol3.toString()); | ||
// expected output: "Symbol(foo)" | ||
|
||
console.log(Symbol('foo') === Symbol('foo')); | ||
// expected output: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
console.log(Symbol.for('bar') === Symbol.for('bar')); | ||
// expected output: true | ||
|
||
console.log(Symbol('bar') === Symbol('bar')); | ||
// expected output: false | ||
|
||
const symbol1 = Symbol.for('foo'); | ||
|
||
console.log(symbol1.toString()); | ||
// expected output: "Symbol(foo)" |
Oops, something went wrong.