Learning JavaScript Design Patterns by Addy Osmani
| String Properties | description |
|---|---|
| String length | The length property of a String object contains the length of the string, in UTF-16 code units. length is a read-only data property of string instances. |
| String Methods | description |
|---|---|
| String.prototype[@@iterator] | Returns a new iterator object that iterates over the code points of a String value, returning each code point as a String value. |
| String.prototype.charAt() | Returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string. |
| String.prototype.charCodeAt() | Returns an integer between 0 and 65535 representing the UTF-16 code unit at the given index. |
| String.prototype.codePointAt() | Returns a non-negative integer that is the UTF-16 code point value. |
| String.prototype.concat() | Concatenates the string arguments to the calling string and returns a new string. |
| String.prototype.endsWith() | Determines whether a string ends with the characters of a specified string, returning true or false as appropriate. |
| String.fromCharCode() | Determines whether a string ends with the characters of a specified string, returning true or false as appropriate. |
| String.fromCodePoint() | Returns a string created by using the specified sequence of code points. |
| String.prototype.includes() | Determines whether one string may be found within another string, returning true or false as appropriate. |
| String.prototype.indexOf() | Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex. Returns -1 if the value is not found. |
| String.prototype.lastIndexOf() | Returns the index within the calling String object of the last occurrence of the specified value, searching backwards from fromIndex. Returns -1 if the value is not found. |
| String.prototype.localeCompare() | Returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. |
| String.prototype.match() | Retrieves the result of matching a string against a regular expression. |
| String.prototype.matchAll() | Returns an iterator of all results matching a string against a regular expression, including capturing groups. |
| String.prototype.normalize() | Returns the Unicode Normalization Form of the string. |
| String.prototype.padEnd() | Pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end of the current string. |
| String.prototype.padStart() | Pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length. The padding is applied from the start of the current string. |
π MDN
JavaScript reference
JavaScript reference > Standard built-in objects
JavaScript reference > Standard built-in objects > String
π FreeCodeCamp
JavaScript Algorithms and Data Structures Certification (300 hours)
index:
var
assignment operator ("=")
NaN
Case Sensitivity
Arithmetic operators ("+", "-", "*", "/")
Increment ("++")
Decrement ("--")
Unary negation (-"1" = -1)
Unary plus (+"1" = 1)
Floats (0.1)
Remainder (%)
Compound Assignment ("+=", "-=", "*=", "/=")
String ("string", 'string', `string`)
String - Escaping Literal Quotes ("..."..."")
String - Quoting ('this is a "string"')
String - Escaping ("\'", "\"", ...)
String - Concatenating ("+", "+=")
String - with Variables ("..." + myVariable + "...")
String - Appending Variables (myString1 += myString2)
String - Length ("string".length)
String - Bracket Notation (myString[0], myString[1], ...)
String - Immutability
String - Nth Character (myString[1], ...)
String - Last Character (myString[myString.length - 1])
String - Nth-to-Last Character (myString[myString.length - 3])
Array (myArray = ["Marcelo", 39])
Array - Nested Arrays (myArray = [ ["the universe", 42], [ ["everything", 101010] ])
Array - Index - Access (myArray[0], myArray[1], ...)
Array - Index - Modify (myArray[0] = 1)
Array - Multi-Dimensional - Access (myArray[3][0][0]))
Array - push() (myArray.push(["dog", 3]))
Array - pop() (myArray.pop())
Array - shift() (myArray.shift())
Array - unshift() (myArray.unshift())
Function (function functionName() {})
Function - Arguments (function functionName(a, b) {})
Function - Global Scope
Function - Local Scope
Function - Return
Function - Undefined
Stand in Line (queue)
Boolean (true, false)
if statements
Equality operator ("==")
Strict Equality operator ("===")
Inequality operator ("!=")
Strict Inequality operator ("!==")
Greater Than operator (">")
Greater Than Or Equal To operator (">=")
Less Than operator ("<")
Less Than Or Equal To operator ("<=")
Logical And operator ("&&")
Logical Or operator ("||")
else statements
else if statements
switch statements
switch statements - Default Option
switch statements - Multiple Identical Options
Exercise "Counting Cards"
Objects (var cat = { "name": "Whiskers", "legs": 4};)
Objects - Accessing Object Properties with Dot Notation
Objects - Accessing Object Properties with Bracket Notation
Objects - Accessing Object Properties with Variables
Objects - Updating Object Properties
Objects - Add New Properties
Objects - Delete Properties
Objects - Using Objects for Lookups
Objects - Testing Objects for Properties (.hasOwnProperty())
Objects - Manipulating Complex Objects
Objects - Accessing Nested Objects
Objects - Accessing Nested Arrays
Exercise "Record Collection"
Iterate with JavaScript While Loops
Iterate with JavaScript For Loops
Iterate Odd Numbers With a For Loop
Iterate Through an Array with a For Loop
Nesting For Loops
Iterate with JavaScript Do...While Loops
Replace Loops using Recursion
Exercise "Profile Lookup"
Generate Random Fractions with JavaScript (Math.random())
Generate Random Whole Numbers with JavaScript (Math.floor())
Generate Random Whole Numbers within a Range
Use the parseInt Function(parseInt())
Use the parseInt Function with a Radix
Use the Conditional (Ternary) Operator
Use Multiple Conditional (Ternary) Operators
Use Recursion to Create a Countdown
Use Recursion to Create a Range of Numbers
very easy:
How Edabit Works
Alphabet Soup
Are the Numbers Equal?
Area of a Triangle
Buggy Code (Part 1)
Check if an Integer is Divisible By Five
Compare Strings by Count of Characters
Convert Age to Days
Convert Hours and Minutes into Seconds
Convert Hours into Seconds
Convert Minutes into Seconds
Correct the Mistakes
Divides Evenly
Drinks Allowed?
Equality Check
Evaluate an Equation
Find the Perimeter of a Rectangle
Football Points
Is the Number Less than or Equal to Zero?
Is the String Empty?
Less Than 100?
Letters Only
Maximum Edge of a Triangle
Movie Theatre Admittance
Recursion: Length of a String
Return a String as an Integer
Return Something to Me!
Return the First Element in an Array
Return the Next Number from the Integer Passed
Return the Remainder from Two Numbers
Return the Sum of Two Numbers
Solve the Equation
The Farm Problem
Using the "&&" Operator
Word without First Character
easy:
Sort Numbers in Descending Order
Reverse the Case
Hiding the Card Number
medium:
Finding Nemo
Return the Middle Character(s) of a String
hard:
Reverse the Odd Length Words
very hard:
Game of Thrones: Character Titles
