Skip to content

Instantly share code, notes, and snippets.

@mrsweaters
Created September 16, 2015 23:00
Show Gist options
  • Select an option

  • Save mrsweaters/f6046f2e6ec5aca4dd70 to your computer and use it in GitHub Desktop.

Select an option

Save mrsweaters/f6046f2e6ec5aca4dd70 to your computer and use it in GitHub Desktop.
+new Date()
1442443788513
"notableNote"+new Date()
"notableNoteWed Sep 16 2015 15:50:25 GMT-0700 (PDT)"
"notableNote"+(+new Date())
"notableNote1442443833329"
Node('div')
Uncaught TypeError: Illegal constructor(…)
var div = document.createElement("div");
undefined
var noteEl = document.createElement("div");
undefined
noteEl
<div>​</div>​
noteEl.setAttribute('date-note-id', +new Date())
undefined
noteEl
<div date-note-id=​"1442443974227">​</div>​
new Object
Object {}
var note = new Object
undefined
note.elId = noteEl.getAttribute('date-note-id')
"1442443974227"
note.elId
"1442443974227"
note
Object {elId: "1442443974227"}
var Annotator = function () {}
undefined
Annotator.prototype.init = function () {}
() {}
var Annotator = function () { self.init(); };
undefined
Annotator.prototype.init = function () {}
() {}
Annotator.prototype.init = function () {console.log('dude');}
() {console.log('dude');}
var annotator = new Annotator();
Uncaught TypeError: self.init is not a function(…)
Annotator.prototype.init = function () {console.log('dude');}
() {console.log('dude');}
var annotator = new Annotator();
Uncaught TypeError: self.init is not a function(…)
var Annotator = function () { };
undefined
Annotator.prototype.init = function () {console.log('dude');}
() {console.log('dude');}
var annotator = new Annotator();
undefined
annotator.init()
dude
undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment