Headings from h1 through h6 are constructed with a # for each level:
# h1 Heading
## h2 Heading
### h3 Heading| function foo () { | |
| console.log("Simple function call"); | |
| console.log(this === window); | |
| } | |
| foo(); //prints true on console | |
| console.log(this === window) //Prints true on console. |
| (function(){ | |
| console.log("Anonymous function invocation"); | |
| console.log(this === window); | |
| })(); | |
| // Prints true on console |
| function foo () { | |
| 'use strict'; | |
| console.log("Simple function call") | |
| console.log(this === window); | |
| } | |
| foo(); //prints false on console as in “strict mode” value of “this” in global execution context is undefined. |
| function Person(fn, ln) { | |
| this.first_name = fn; | |
| this.last_name = ln; | |
| this.displayName = function() { | |
| console.log(`Name: ${this.first_name} ${this.last_name}`); | |
| } | |
| } | |
| let person = new Person("John", "Reed"); |
| function foo () { | |
| 'use strict'; | |
| console.log("Simple function call") | |
| console.log(this === window); | |
| } | |
| let user = { | |
| count: 10, | |
| foo: foo, | |
| foo1: function() { |
| function Person(fn, ln) { | |
| this.first_name = fn; | |
| this.last_name = ln; | |
| this.displayName = function() { | |
| console.log(`Name: ${this.first_name} ${this.last_name}`); | |
| } | |
| } | |
| let person = new Person("John", "Reed"); |
| function Person(fn, ln) { | |
| this.first_name = fn; | |
| this.last_name = ln; | |
| this.displayName = function() { | |
| console.log(`Name: ${this.first_name} ${this.last_name}`); | |
| } | |
| } | |
| let person = new Person("John", "Reed"); |
| function multiply(p, q, callback) { | |
| callback(p * q); | |
| } | |
| let user = { | |
| a: 2, | |
| b:3, | |
| findMultiply: function() { | |
| multiply(this.a, this.b, function(total) { | |
| console.log(total); |
| var count = 5; | |
| function test () { | |
| console.log(this.count === 5); | |
| } | |
| test() // Prints true as “count” variable declaration happened in global execution context so count will become part of global object. |