Skip to content

Instantly share code, notes, and snippets.

@charliegerard
Last active August 29, 2015 13:57
Show Gist options
  • Save charliegerard/9904193 to your computer and use it in GitHub Desktop.
Save charliegerard/9904193 to your computer and use it in GitHub Desktop.

#Day31

morning exercise: https://gist.github.com/mathildathompson/9903238

The browser identifies itself to a server using a User agent string.

Modernizr: http://modernizr.com/

Double equals vs triple equals: http://dorey.github.io/JavaScript-Equality-Table/


####Objects

Objects are basically like hashes in ruby.

Teaching material: http://www.teaching-materials.org/javascript/slides/objectsdom.html

JSON = Javascript Object Notation.

The following example is JSON.

var lizzieTheCat = { age: 18, furColor: "grey", likes: ["catnip", "milk"], birthday: {"month": 7, "day": 17, year: 1994} };

Javascript objects exercises: https://gist.github.com/coldhead/c5187bd217631022868f

"this" can refer to an element inside an object.


###Inheritance

Inheritance example: http://jsbin.com/huqisaju/1/edit

when calling a function in an object, do not forget the parentheses at the end or only the function will be displayed, not the actual value it should return.

Working with moments and dates in javascript: http://momentjs.com/

Triangle exercise crappy version: http://jsbin.com/gayefire/1/edit classy version: http://jsbin.com/gayefire/2/edit Triangle new version: http://jsbin.com/gayefire/3/edit

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