Understand function scope by logging a variable from inside and outside a function.
declareFunction
over 1 year agoDeclare a function named greet that logs 'Hello, world!' to the console.
hoistMe
over 1 year agoCall a function before its declaration to see how hoisting works in function declarations.
logArguments
over 1 year agoCreate a function that logs all received arguments using the arguments object.
sumRest
over 1 year agoUse the rest operator to accept any number of arguments and log their total.
greetDefault
over 1 year agoCreate a function that greets a name. If no name is passed, it should greet 'Guest'.
personAge
over 1 year agoCreate an object with a getter and setter for the age property.
scopeExample
over 1 year agoUnderstand function scope by logging a variable from inside and outside a function.
thisKeyword
over 1 year agoLog the value of 'this' inside an object method.
methodVsFunction
over 1 year agoCreate an object method and a standalone function and log 'this' in both.
PersonConstructor
over 1 year agoCreate a constructor function to build a person object with a name and age.
bindThis
over 1 year agoUse bind to explicitly set the value of 'this' when calling a function.