Skip to content

Conversation

@sfarnsworthkum
Copy link

No description provided.

Copy link
Contributor

@elie elie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your indentation, make sure you're using 2 spaces. Keep it up!

//_.drop([1, 2, 3]);
// => [2, 3]
function drop(array, n){
if (n === undefined){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your indentation - 2 spaces please!



function fromPairs(array) {
if(array.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better on the indentation front!

}

function head(array){
return array.shift();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your indentation - 2 spaces please!

}

function take(array, num){
var newArr = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your indentation - 2 spaces please!

function takeRight(array, num){
if (num === 0) {
return [];
} else if (num >= array.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your indentation - this stuff will drive developers crazy :)

return (input.indexOf(value) != -1);
}
} else if (typeof input === "string") {
return (input.indexOf(value) != -1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for () here

}

function sample(arr){
return arr[Math.floor(Math.random() * (arr.length))];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for () around arr.length

//contains(nestedObject, 44) // true
//contains(nestedObject, "foo") // false
function contains(obj, value) {
return collectStrings(obj).indexOf(value) !== -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Try to do this without using your collectStrings method :)


// WRITE YOUR TESTS HERE!
describe("replaceWith", function () {
it("replaces a capital with a capital", function(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your indentation - 2 spaces please.

});
//Write a function called mergeObjects which takes in two objects and return an object with the keys and values combined. If the second parameter has the same key - it should override first one. There is a built in function called Object.assign - research it, but do not use it, try to do this on your own!
describe("mergeObjects", function () {
it("returns an object with combined keys and values", function(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation - 2 spaces please!

Copy link
Contributor

@elie elie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it up - try to finish these lodash exercises!

var name = "Josie"
console.log("When " + name + " comes home, so good")
console.log(`When ${name} comes home, so good`);
//Steely Dan?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know it!

@@ -1,15 +1,88 @@
window.addEventListener("load", function() {
//flow of what needs to happen:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start and your code looks clean so far. Try to add the seconds timer and stop the game after 30 seconds have passed.



String.prototype.reverse = function () {
var result = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job using an array here.

Function.prototype.bind = function (thisArg, ...outerArgs){
var _this = this;
return function (...innerArgs) {
return _this.apply(thisArg, outerArgs.concat(innerArgs));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    👍

}
}
}
///yeah still need clarification on how this works ^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want me to go over this with you. Looks like you go it right.

}
}

function sayHi() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could change this to:

 var obj = {
     fullName: "Harry Potter",
     person: {
         sayHi: function(){
             return "This person's name is " + this.fullName
          }
      }
  }
obj.person.sayHi = obj.person.sayHi.bind(obj);

That way, you preserve the structure.

}
var person2 = {
fullName: "Harry Potter",
sayHi: function(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be simplified more:

var person2 = {
  fullName: "Harry Potter",
  sayHi() {
    setTimeout( () => console.log(`Your name is ${this.fullName}`), 1000)
  }
}

}

function inRange(){
function inRange() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to work on the rest of these when you get a chance.

Function.prototype.bind = function (thisArg, ...outerArgs){
var _this = this;
return function (...innerArgs) {
return _this.apply(thisArg, outerArgs.concat(innerArgs));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tigarcia
Copy link
Contributor

Hey Sarah, have you made progress on the hacker snooze app? I didn't see any changes related to that in your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants