[Week 1 - TAAQUI GIPHY] · Lesson 3 · 10 minutes
We've just declared three variables - one is a string, or a series of characters. One is a number. And one is a boolean, or a true/false statement.
.fullName is a string property of the object TaqKarim, with a string value of "Mottaqui Karim."
In a more complex example, you can take advantage of certain properties of an object in order to create a function:
If you don't already know what it does, the console.log is going to be a trusty companion throughout this course and your coding life. It's function that logs, or records, the results of a function or the different values we're passing into that parenthesis on the console, which you can access by right clicking on a Chrome browser page and selecting inspect.
This type of function, a function which is also the property of an object the way .log is a property of the object 'console,' can be called a method.
You can also write a function so that it returns the whole of an object. Like so:
What this illustrates is our original four lines of code. Document is an object, with a function called querySelector, which runs with the the parameter .jsgo we passed in; and another function, .addEventListener, works in reaction to that, with the arguments click and onGoBtnClicked, which we've defined.