Lecture 11 (ajax, string functions, classes) Flashcards
promise
ex. fetch returns a promise object representing the eventual completion or failure of an asynchronous operation promise = new Promise(function(resolve, reject) {})
what do we use to work with promises?
then and catch
ajax
asynchronous javascript and xml
asynchronous
happens in the background and the user can perform other actions on the page
are strings immutable
yes, and iterable
trim
removes white trailing and ending whitespace
toUpperCase, toLowerCase
self
substring
takes two indexes and return first argument and second argument - 1
split
takes an argument and splits the original string where that argument appears
includes
check if the string includes the argument
indexOf
returns the index of the argument
setInterval
calls a function at specified intervals
clearInterval
clears the interval
setTimeout
call a function after a specified duration
Date
object is used to work with dates and times
let d = new Date()
console.log(d.getFullYear()); // 2020