This file contains 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
<div id="app"> | |
<nav class="navbar navbar-light fixed-top"> | |
<div class="navbar-text ml-auto d-flex"> | |
<button class="btn btn-sm btn-outline-success" | |
@click="sliderStatus = !sliderStatus"> | |
<i class="fas fa-dollar-sign"></i></button> | |
<div class="ml-2"> | |
<button class="btn btn-success btn-sm dropdown-toggle" | |
id="cartDropdown" data-toggle="dropdown" | |
aria-haspopup="true" aria-expanded="false"> |
This file contains 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
<div id="app"> | |
<h1 class="bg-light fixed-top">{{name}}</h1> | |
<nav class="navbar navbar-light "> | |
<div class="navbar-text ml-auto"> | |
<b>cart:</b> | |
<span class="badge badge-pill badge-success"></span> | |
</div> | |
</nav> | |
This file contains 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
// What would be the output of following code | |
var employeeId = 'abc123'; | |
function foo() { | |
employeeId = '123bcd'; | |
return; | |
function employeeId() {} | |
} |
This file contains 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
// What would be the output of following code? | |
var arrA = [{prop1: "value of array A!!"}, {someProp: "also value of array A!"}]; | |
var arrB = arrA.slice(); | |
arrB[0].prop1=42; | |
console.log(arrA); |
This file contains 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 a(){ | |
console.log(this.abc); | |
} | |
Function.prototype.bindMe = function(scope){ | |
return function(args){ | |
this.apply(scope, args); | |
}.bind(this) | |
} |
This file contains 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
"use strict"; | |
var animal = { | |
kind: "Cow", | |
which: function () { | |
console.log(this.kind); | |
} | |
}; | |
var animalFunc = animal.which; | |
animalFunc(); |
This file contains 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
// construction pattern | |
function abc(a,b){ | |
this.a=a; | |
this.b=b; | |
} | |
var obj = new abc('123','456') |
This file contains 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
// construction pattern | |
function abc(a,b){ | |
this.a=a; | |
this.b=b; | |
} | |
var obj = new abc('123','456') |
This file contains 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
var a = { | |
m: function() { | |
console.log(this); // {m:f} | |
(function(){ | |
console.log(this); // window object | |
})(); | |
} | |
} | |
a.m(); | |
// {m:f} |
NewerOlder