This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function checkEquality() { | |
| console.log("1" == 1); | |
| console.log("1" === 1); | |
| console.log("1" === true); | |
| console.log(1 == true); | |
| console.log("" == 0) | |
| } | |
| checkEquality(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch('http://some-site.com/cors-enabled/some.json', {mode: 'cors'}) | |
| .then(function(response) { | |
| return response.text(); | |
| }) | |
| .then(function(text) { | |
| console.log('Request successful', text); | |
| }) | |
| .catch(function(error) { | |
| log('Request failed', error) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Which of the following is the correct method to import File.. | |
| import {Color, Animal} from './Shapes'; | |
| import Color, Animal from './Shapes'; | |
| import [Color, Animal] from './Shapes'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from "@angular/core"; | |
| @Component({ | |
| selector: 'employee-details', | |
| template: ` | |
| <div> | |
| <p>Employee Name: {{employeeName}}</p> | |
| <p>Employee Age: {{employeeAge}}</p> | |
| <p>Employee Name: {{employeeDesignation}}</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typeof undefined | |
| typeof 0 | |
| typeof true | |
| typeof "foo" | |
| typeof Symbol("id") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Creating Object Literals | |
| var userData = { | |
| name: "Mayank", | |
| age: 30, | |
| designation: "developer" | |
| } | |
| // Creating Object with "new" keyword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Creating Simple Functions | |
| function alertData() { | |
| alert("data") | |
| } | |
| // Calling Functions | |
| alertData(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function EmployeeDetails() { | |
| var name: "Mayank"; | |
| var age = 30; | |
| var designation = "Developer" | |
| return { | |
| name: name, | |
| age: age, | |
| designation: designation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function EmployeeDetails() { | |
| var name: "Mayank"; | |
| var age = 30; | |
| var designation = "Developer", | |
| var salary = 10000; | |
| return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function EmployeeDetails() { | |
| var name: "Mayank"; | |
| var age = 30; | |
| var designation = "Developer", | |
| var salary = 10000; | |
| var calculateBonus = function(amount) { | |
| salary = salary + amount; | |
| } |