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
// 1) Challenges starting from question 139 seem to be calling for methods that I do not know about, nor do I know what to google. Do you have suggestion on how best to solve for these? | |
// 2) I would like to see sort() being used | |
// var array1 = [1, 30, 4, 21, 100000, 2 ,3 ,445 ,3, 345, 34567,]; | |
// console.log(array1.sort(function(a, b) { | |
// return a - b; | |
// })) | |
// 3) I would like to talk about how to create new lines |
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
// Exercise 1 (conditionals) | |
// Write a function lesserNum which takes in two integer arguments, and returns the lesser of the two. If they're equal, return either. | |
function lesserNum(num1, num2) { | |
if (num1 === num2) { | |
return num1; | |
} | |
return num1 > num2 ? num2 : num1; | |
} | |
// You should be able to call it like so: |
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
// Self Assessment 3 | |
// Note: | |
// Most of the problems in this assessment will not have function skeletons created for you. Please read the prompts and carefully construct your functions based on the function names and number of arguments it expects. Without properly named functions, your submissions will not pass the back-end tests. | |
// e.g. sayHello (camel-cased function name) is not the same function as sayhello (non-camel-cased function name) | |
// Exercise 1 (writing functions) | |
// Write a function identity which expects 1 argument and simply returns that input value. | |
// Calling your function should result in: |
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 you can take a basic example to explain how to write a test function | |
function testEquality(actual, expected, testName) { | |
if (actual.length === expected.length) { | |
console.log('pass'); | |
} else if (actual !== expected) { | |
console.log('FAILED TEST: ' + testName + 'Expected: ' + expected + ' but got: ' + actual); | |
} | |
} |
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 salesTeam = [{name: {first: 'Aleen', last: 'Atkins'}, age: 26, sales: '$2314'}, | |
{name: {first: 'Denese', last: 'Dossett'}, age: 29, sales: '$9248'}, | |
{name: {first: 'Douglas', last: 'Denney'}, age: 53, sales: '$5058'}, | |
{name: {first: 'Earline', last: 'Erickson'}, age: 19, sales: '$18876'}, | |
{name: {first: 'Herman', last: 'Hazell'}, age: 25, sales: '$2746'}, | |
{name: {first: 'Homer', last: 'Hirth'}, age: 26, sales: '$474'}, | |
{name: {first: 'Hwa', last: 'Heidt'}, age: 53, sales: '$9607'}, | |
{name: {first: 'Hyon', last: 'Hampshire'}, age: 46, sales: '$13598'}, | |
{name: {first: 'Issac', last: 'Ingerson'}, age: 45, sales: '$5225'}, | |
{name: {first: 'Jeraldine', last: 'Joplin'}, age: 39, sales: '$2891'}, |
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 salesTeam = [{name: {first: 'Aleen', last: 'Atkins'}, age: 26, sales: '$2314'}, | |
{name: {first: 'Alvaro', last: 'Angelos'}, age: 55, sales: '$1668'}, | |
{name: {first: 'Denese', last: 'Dossett'}, age: 29, sales: '$9248'}, | |
{name: {first: 'Douglas', last: 'Denney'}, age: 53, sales: '$5058'}, | |
{name: {first: 'Earline', last: 'Erickson'}, age: 19, sales: '$18876'}, | |
{name: {first: 'Herman', last: 'Hazell'}, age: 25, sales: '$2746'}, | |
{name: {first: 'Homer', last: 'Hirth'}, age: 26, sales: '$474'}, | |
{name: {first: 'Hwa', last: 'Heidt'}, age: 53, sales: '$9607'}, | |
{name: {first: 'Hyon', last: 'Hampshire'}, age: 46, sales: '$13598'}, | |
{name: {first: 'Issac', last: 'Ingerson'}, age: 45, sales: '$5225'}, |
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
// Sales Team | |
// You are managing a sales team and you are interested is analyzing some data related to their age and total sales. Take a moment to review the following data structure you will be analyzing: | |
var salesTeam = [ | |
{"name":"Aleen Atkins","salesInfo":{"totalSales":"$2314","numSales":19},"yearBorn":1991}, | |
{"name":"Alvaro Angelos","salesInfo":{"totalSales":"$1668","numSales":17},"yearBorn":1962}, | |
{"name":"Denese Dossett","salesInfo":{"totalSales":"$9248","numSales":18},"yearBorn":1988}, | |
{"name":"Douglas Denney","salesInfo":{"totalSales":"$5058","numSales":15},"yearBorn":1964}, | |
{"name":"Earline Erickson","salesInfo":{"totalSales":"$18876","numSales":11},"yearBorn":1998}, | |
{"name":"Herman Hazell","salesInfo":{"totalSales":"$2746","numSales":12},"yearBorn":1992}, |
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
// Sales Team | |
// You are managing a sales team and you are interested is analyzing some data related to their age and total sales. Take a moment to review the following data structure you will be analyzing: | |
var salesTeam = [ | |
{"name":"Aleen Atkins","salesInfo":{"totalSales":"$2314","numSales":19},"yearBorn":1991}, | |
{"name":"Alvaro Angelos","salesInfo":{"totalSales":"$1668","numSales":17},"yearBorn":1962}, | |
{"name":"Denese Dossett","salesInfo":{"totalSales":"$9248","numSales":18},"yearBorn":1988}, | |
{"name":"Douglas Denney","salesInfo":{"totalSales":"$5058","numSales":15},"yearBorn":1964}, | |
{"name":"Earline Erickson","salesInfo":{"totalSales":"$18876","numSales":11},"yearBorn":1998}, | |
{"name":"Herman Hazell","salesInfo":{"totalSales":"$2746","numSales":12},"yearBorn":1992}, |
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
Sample incoming information from Analytics with updates to local DB | |
this is data.Messages.Body {"userId":7,"interests":[10,3,2],"ratio":0.155,"numAds":4} | |
updating userID: 7 | |
this is data.Messages.Body {"userId":8,"interests":[3,6,9],"ratio":0.133,"numAds":4} | |
updating userID: 8 | |
this is data.Messages.Body {"userId":3,"interests":[10,8,6],"ratio":0.04,"numAds":1} | |
updating userID: 3 | |
Message Deleted { ResponseMetadata: { RequestId: '3ab162a1-4c53-57d8-a885-30dcd9f4dc6a' } } | |
Message Deleted { ResponseMetadata: { RequestId: '1b20be58-48a1-5c71-ab96-ec25dd06c3c1' } } |