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
const readline = require('readline'); | |
const mike = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
// var person = function(personName,personAge){ | |
// let name = personName; | |
// let age = personAge; |
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 lookUpProfile(firstName, prop){ | |
// Only change code below this line | |
var match = contacts.filter(function(x){ | |
return x.firstName == firstName; | |
}); | |
console.log('match',match[0]); | |
if(match[0]){ | |
if(match[0].hasOwnProperty(prop)){ |
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
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'LinkedInExample', | |
template: '<a [href]="url">LinkedIn</a>' | |
}) | |
export class LinkedInExample{ | |
client_id: String = 'InputYourStupidClientStringHere'; | |
redirect_uri:String = encodeURI("http://localhost:5000/whateverthehell"); |
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
const arr = ['a','aab','bbc','aass'] | |
let newArr = arr.reduce(function (str, item) { | |
if (item.includes('a')) { | |
console.log(item) | |
str = str + item; | |
} | |
return str; | |
}, ''); |
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
interface IStrategy { | |
id: string, | |
test: (item: string) => boolean, | |
transform: (item: string) => Promise<any> | string | |
} | |
const strategies: IStrategy[] = [ | |
{ | |
id: 'some-name', | |
test: (item: string) => true | false, |