Loading
Johan Kohlin
This is a live streamed presentation. You will automatically follow the presenter and see the slide they're currently on.
method/property | description |
---|---|
name.length | The number of characters in the string. (12) |
name.charAt(0) | Extracts the character at a given index/position ("J") |
name.indexOf(" ") | Searches the string for a character or string. Returns it's index (5) |
name.slice(6) | Returns a slice or substring of a string ("Rocker") |
name.split(" ") | Splits a string into an array, using a delimiter ( ["Jolly, "Rocker"] ) |
name.toLowerCase() | Returns a copy of the string in lower case ("jolly rocker") |
name.toUpperCase() | Returns a copy of the string in upper case ("JOLLY ROCKER") |
assuming you have:
var name = "Jolly Rocker"
var name = "Alexander" var part = name.slice(4,7) // and
Alexander
012345678
var name = "Alexander" var part = name.slice(3) // xander
Alexander
012345678
if the end-parameter is missing, it slices to the end of the string
between any two numbers
var min = -15; // ANY number you want
var max = 10; // a higher number than min.
var random = Math.floor(Math.random() * (max-min+1)+min);
var random = Math.round( Math.random() );
the character at position...
var vowels = "aeiouy"
// 012345
var letterU = vowels.charAt(4)