Skip to content

Instantly share code, notes, and snippets.

View jitendra19's full-sized avatar
🎯
Focusing

Jitendra Singhal jitendra19

🎯
Focusing
View GitHub Profile
@jitendra19
jitendra19 / index.html
Created April 25, 2020 17:38
Vue/Bootstrap Template
<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">
@jitendra19
jitendra19 / index.html
Created April 23, 2020 18:32
vue JS practice
<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>
// What would be the output of following code
var employeeId = 'abc123';
function foo() {
employeeId = '123bcd';
return;
function employeeId() {}
}
// 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);
function a(){
console.log(this.abc);
}
Function.prototype.bindMe = function(scope){
return function(args){
this.apply(scope, args);
}.bind(this)
}
"use strict";
var animal = {
kind: "Cow",
which: function () {
console.log(this.kind);
}
};
var animalFunc = animal.which;
animalFunc();
// construction pattern
function abc(a,b){
this.a=a;
this.b=b;
}
var obj = new abc('123','456')
// construction pattern
function abc(a,b){
this.a=a;
this.b=b;
}
var obj = new abc('123','456')
var a = {
m: function() {
console.log(this); // {m:f}
(function(){
console.log(this); // window object
})();
}
}
a.m();
// {m:f}