Skip to content

Instantly share code, notes, and snippets.

View stephenotalora's full-sized avatar
🚀
ship it

Jonathan stephenotalora

🚀
ship it
  • GitHub Staff
  • Vancouver Canada
View GitHub Profile
@stephenotalora
stephenotalora / linkedList.js
Created February 14, 2018 07:19 — forked from primaryobjects/linkedList.js
Reverse a Linked List in JavaScript.
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @return {ListNode}
@stephenotalora
stephenotalora / Bind.md
Last active August 29, 2015 14:26 — forked from limianwang/Bind.md
Tutorial: Bind Function

In the powerful world of JS, you can do a lot of crazy things with Bind/Apply/Call. Here, I can show a small example so that it can be easily understood.

function test1(a, b, c) {
  console.log(Array.prototype.slice.call(arguments));
  // What will this output?
}

function test2(fn) {
 fn();