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, async } from '@angular/core/testing'; | |
| import { AppComponent } from './app.component'; | |
| import { UserComponent } from './user/user.component'; | |
| import { UserAsyncComponent } from './user-async/user-async.component'; | |
| describe('App component', () => { | |
| beforeEach(async(() => { | |
| // The TestBed is the most important of the Angular testing utilities. | |
| // The TestBed creates a dynamically-constructed Angular test module that emulates an Angular @NgModule. |
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, async } from '@angular/core/testing'; | |
| import { AppComponent } from './app.component'; | |
| describe('App component', () => { | |
| beforeEach(async(() => { | |
| // The TestBed is the most important of the Angular testing utilities. | |
| // The TestBed creates a dynamically-constructed Angular test module that emulates an Angular @NgModule. | |
| // The TestBed.configureTestingModule() method takes a metadata object that can have most of the properties of an @NgModule. | |
| TestBed.configureTestingModule({ | |
| declarations: [AppComponent] |
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 ascendingOrder = function(a,b){ | |
| return a - b; | |
| }, | |
| BinarySearch = function(array,value){ | |
| let start = 0; | |
| let stop = array.length - 1; | |
| let middle = Math.floor((start + stop)/2); | |
| while(array[middle] !== value && start < stop){ |
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
| function sumOfTwoNum(array,target){ | |
| let storeMap = {}; | |
| for(let arr of array){ | |
| if(storeMap[arr]){ | |
| return true; | |
| } | |
| storeMap[target - arr] = arr; | |
| } |
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
| // Input [10, 15, 3, 7], Target : 17 | |
| // if yes then return true else false. | |
| // Brute force way. | |
| //Solution 1: | |
| function sumOfTwoNum(arr,target){ | |
| for(let i = 0 ; i < arr.length; i ++){ | |
| for(let j = 0; j < arr.length; j++){ |
NewerOlder