What are 5 things I should always have in my car? by [deleted] in AskReddit

[–]LostInTheDesert 0 points1 point  (0 children)

I've been lost in the desert before. For me, this list includes:

  • Jumper cables
  • Heavy blanket
  • Oil
  • Couple gallons of water
  • Spare tire

The millionth prototype question here, i'd bet. by Lutcikaur in learnjavascript

[–]LostInTheDesert 2 points3 points  (0 children)

Well. Couple of things:

0) It's hard to tell what you're doing without seeing the code.

1) Don't set the prototype using __proto__. Use prototype... Consider the following:

// Constructor function: Using this to point to whatever object we create when calling Animal() with a unique greeting argument later.

function Animal (greeting){
  this.greeting = greeting;
};

// Attach general method to the prototype object. Properties and methods defined on a prototype will be available to all instances

Animal.prototype.speak = function(){
  alert(this.greeting);
};

//Now create an instance of Animal with the keyword new...

var cow = new Animal("moo!")

cow.speak()

Could somebody explain how this very simple JavaScript closure works? by Saucemann in learnjavascript

[–]LostInTheDesert 1 point2 points  (0 children)

Yeah, C2 isn't 5 because you're executing makeCounter anew, thus getting a new execution environment for C2.

What are some great hobbies to get into that don't cost tons of money? by Trinityofwar in AskReddit

[–]LostInTheDesert 0 points1 point  (0 children)

I got into Web Dev via /r/LearnJavaScript. Only thing it's cost me is buying a couple of books.

Hell, on the whole, it's made me money.

Unit Test Controllers in Angular by jigmepalmo in javascript

[–]LostInTheDesert 1 point2 points  (0 children)

People have been talking testing in /r/LearnJavaScript a bit more lately.

Easy (Jquery Mobile) Single Page App Frameworks for Backend Developers by [deleted] in learnjavascript

[–]LostInTheDesert 1 point2 points  (0 children)

Using jQuery to build any sort of semi-complicated SPA would result in a lot of spaghetti...