JS 4, spread and rest operators, Error constructor and object, TRY, CATCH and FINALLY
function defaultParameter(name = "sam") {
return console.log( name);
}
defaultParameter("oltre") //"oltre"
defaultParameter() //"sam"//The longer the array is, the more complex the copy operation becomes
//The push() method keeps its complexity indipendently of the length
//The push() will print the new length of the mutated array.
let base = [1, 2, 3, 4, 5]
let base1 = [...base, 12]
console.log( base1 ) //(6)[1, 2, 3, 4, 5, 12]
console.log( base ) //(5)[1, 2, 3, 4, 5]
let mosso = [1, 2, 3, 4, 5]
console.log( mosso.push(13) ) //6
console.log( mosso ) //(6)[1, 2, 3, 4, 5, 13]Error constructor and Object
Last updated