View reduce
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; | |
}, ''); |
View LinkedInComponent.ts
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"); |
View freecodecampObjPropLookup.js
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)){ |
View example.js
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; |