Skip to content

Instantly share code, notes, and snippets.

View Mayankgupta688's full-sized avatar
💭
Corporate and Online Trainer with 8+ years of Experience...

Mayank Gupta Mayankgupta688

💭
Corporate and Online Trainer with 8+ years of Experience...
View GitHub Profile
@Mayankgupta688
Mayankgupta688 / checkingEquality.js
Last active May 29, 2019 18:46
ES6 Questions For Evaluation
function checkEquality() {
console.log("1" == 1);
console.log("1" === 1);
console.log("1" === true);
console.log(1 == true);
console.log("" == 0)
}
checkEquality();
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)
});
// 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';
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>
typeof undefined
typeof 0
typeof true
typeof "foo"
typeof Symbol("id")
// Creating Object Literals
var userData = {
name: "Mayank",
age: 30,
designation: "developer"
}
// Creating Object with "new" keyword
// Creating Simple Functions
function alertData() {
alert("data")
}
// Calling Functions
alertData();
function EmployeeDetails() {
var name: "Mayank";
var age = 30;
var designation = "Developer"
return {
name: name,
age: age,
designation: designation
function EmployeeDetails() {
var name: "Mayank";
var age = 30;
var designation = "Developer",
var salary = 10000;
return {
function EmployeeDetails() {
var name: "Mayank";
var age = 30;
var designation = "Developer",
var salary = 10000;
var calculateBonus = function(amount) {
salary = salary + amount;
}