Skip to content

Instantly share code, notes, and snippets.

@harrisonmalone
Last active November 26, 2018 22:48
Show Gist options
  • Save harrisonmalone/1996ba3df2c53e9e4d05fd9556dcd1ca to your computer and use it in GitHub Desktop.
Save harrisonmalone/1996ba3df2c53e9e4d05fd9556dcd1ca to your computer and use it in GitHub Desktop.

Class and objects

morning challenge, counting vowels

class and object basics

looked very briefly at closure, need to look more into that

pointing to a variable

let x = null

let y = 10

x = y

think of variables as pointers to objects, when you assign directly to a variable, you are not modifying any objects you're merely repointing your variable to a different object

factory and constructor functions

.bind()

now moving on to using Class keyword

it just has a nicer clearer syntax that's similar to ruby

getters and setters is again just a sugar syntax

you can just write them as functions

then we did a quick challenge

discrete math recap

decimal to hex count up chart

document.body.scrollHeight
// gets you the scrolling height of a given window
window.scrollY
// gets you the scroll position

matts npm callback challenge

to inspect the given arguments in a method call there are a few options

arguments
// lets you see the arguments passed as an object
function funcName(...args) { // code }
// args gives you an array of arguments

mdn docs for getting args

solution to shelf and books challenge

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