/miru

Primary LanguageJavaScript

Things to know in js.

Built in functions.

isNaN(value); // checks that value is not a number

Built in string functions.

String.split(''); // splits a string into an array

// regular expressions
'a'.match(/[aeiou]/); // matches any vowel
'!'.match(/\w/); // matches a word character
word = words[i].match(/\w*/)[0]; // the match will return an array you can get the word and assign it to a variable by [] syntax.

'a'.charCodeAt() // gives you a character code from a letter
fromCharCode(1); // gives you a letter from character code

String.toUpperCase();

Built in array functions.

Array.reverse();
Array.join('');
Array.length();
Array.filter();
Array.map();
Array.forEach();
Array.reduce();
Array.concat();
Array.split();
Array.sort();
Array.every();