Skip to content

Instantly share code, notes, and snippets.

@GabyL
Forked from mayfer/index.html
Last active August 29, 2015 14:15
Show Gist options
  • Save GabyL/df94cf2c3774d2e2e293 to your computer and use it in GitHub Desktop.
Save GabyL/df94cf2c3774d2e2e293 to your computer and use it in GitHub Desktop.
<html>
<head>
<style>
body { background: #358; color: #fff; padding: 50px; font-family: sans-serif; }
</style>
</head>
<body>
<script>
var methodyObject = function() {
this.my_method = function() {
console.log("YAY a method");
return this;
}
this.other_method = function() {
console.log("omg YAY other");
}
}
var obj = new methodyObject();
var result = obj.my_method().other_method();
console.log(result);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment