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
| if(isVisible) { | |
| console.log('We should use the braces even if there is only one statement in block'); | |
| } |
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
| { | |
| "name": "@uv-tech/util", | |
| "version": "1.0.5", | |
| "description": "It is a utility package intended to be used for doing common utilities.", | |
| "main": "lib/index.js", | |
| "type": "lib", | |
| "scripts": { | |
| "build": "tsc -p ." | |
| }, | |
| "keywords": [ |
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
| const employeeObservable = new Rx.Observable(employeeObserver => { | |
| employeeObserver.next('Yuvraj Patil'); | |
| employeeObserver.next('Ganesh Gaitonde'); | |
| }); | |
| employeeObservable.subscribe(employeeName => { | |
| console.log('Promoted Employee: ', employeeName); | |
| }); |
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
| for(var i=0; i<5; i++) { | |
| (function (i){ | |
| setTimeout(function() { | |
| console.log(i); | |
| }, 0); | |
| })(i); | |
| } |
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 uvHttp = new XMLHttpRequest(); | |
| uvHttp.onreadystatechange = function() { | |
| console.log('HTTP state change callback executed'); | |
| }; | |
| uvHttp.open("GET", "/getUser", true); | |
| uvHttp.send(); |
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.getElementById("add-user").addEventListener("click", addUser); | |
| function addUser() { | |
| console.log('User has been added'); | |
| } |
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 numberOfKingdoms = 7; | |
| setInterval(function(){ | |
| alert('Jon should be king of ' + numberOfKingdoms + ' kingdoms'); | |
| }, 500) |
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 numberOfKingdoms = 7; | |
| setTimeout(function(){ | |
| alert('Jon should be king of ' + numberOfKingdoms + ' kingdoms'); | |
| }, 500); |
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 sodexoAmount = 25; | |
| function getSalary(baseSalary) { | |
| var transportAmount = 50; | |
| function calculateSalary(hraAmount) { | |
| var specialAllowance = 75; | |
| return specialAllowance + hraAmount + baseSalary + transportAmount + sodexoAmount; | |
| } | |
| return calculateSalary; | |
| } | |
| var monthlySalary = getSalary(100); |
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 { TestBed } from '@angular/core/testing'; | |
| import * as globalmocks from '../globalmocks'; | |
| import { UvUtilService } from './uv-util.service'; | |
| describe('UvUtilService', () => { | |
| let service: UvUtilService; | |
| beforeEach(() => { | |
| TestBed.configureTestingModule({}); | |
| service = TestBed.inject(UvUtilService); |