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
/* | |
Take 10 random number. From that to get combination of greater number. | |
Example to take number - 4132 And result to be 4321. | |
*/ | |
let randomNumber = 3159705179; | |
let greaterNbr; | |
let randomNumberArray = (''+randomNumber).split(''); |
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
<!DOCTYPE html> | |
<meta name="robots" content="noindex"> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> |
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
$('document').ready( function(){ | |
//WITHOUT ARROW FUNCTION | |
$('.my-name').on('click', function() { | |
var that = this; | |
setTimeout( function() { | |
$(that).toggleClass('on'); | |
}, 1000); | |
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
//---main.js | |
if (window.Worker) { | |
//worker(aURL, options) | |
const worker = new Worker("worker.js"); | |
worker.onmessage = e => { | |
const msg = e.data; | |
console.log(`From Worker thread: ${msg}`); |
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
//CSS units - viewport - vh,vw,vmax,vmin | |
//Refered in - https://alligator.io/css/viewport-units/ | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
html, body { | |
overflow-x: hidden; | |
} | |
nav { |
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
// Referred in - https://codeburst.io/throttling-and-debouncing-in-javascript-b01cad5c8edf | |
// Start execute the function until, no more action request. Last requrest get performed. | |
// Use case - Auto Save, Submit, file send action | |
const debounce = (func, delay) => { | |
let inDebounce | |
return function() { | |
const context = this | |
const args = arguments | |
clearTimeout(inDebounce) |
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
//Simple Class function | |
function API() { | |
this.name = 'This is API name'; | |
} | |
//prototype function for share between the object | |
API.prototype.getName = function() { | |
//Take copy of this keyword | |
var self = this; |
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
var obj = [ | |
{ "name":'a', "count1": 1, "count2": 9 }, | |
{ "name":'b', "count1": 10, "count2": 4 }, | |
{ "name":'c', "count1": 21, "count2": 93 }, | |
{ "name":'d', "count1": 10, "count2": 10 }, | |
{ "name":'e', "count1": 10, "count2": 2 }, | |
{ "name":'f', "count1": 5, "count2": 9 }, | |
]; |
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
//STRING REVERSE | |
var myStringa = "UI FRONTEND"; | |
myStringa.split('').reverse().join(''); //"DNETNORF IU" |
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
//Angular CLI - Build with base-href and deploy-url options | |
> ng build --prod --base-href /projectName --deploy-url /publicFolderName | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Single Page Application</title> |
NewerOlder