190509-TIL

190509-TIL

Today I Learned

  • Implemented underscore libray’s last function

    Condition complete

    1
    2
    3
    4
    5
    // Like first, but for the last elements. If n is undefined, return just the
    // last element.
    _.last = function(array, n) {
    return n === undefined ? array[array.length-1] : n > array.length ? array : array.slice(array.length-n, array.length);
    };
  • Studied about JavaScript global variable and let, const keyword variables.

# TIL
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×