JSFiddle

  • Hoisting Questions

    No-Library (pure JS), HTML, CSS, JavaScript

    (function(){
      console.log(getName()) // undefined
    	var name = 'justin' 
      function getName(){
      	return name
      }
    })()
  • Javascript Remove

    Js remove

     var obj = {
       items:[
         {
           name:'jason',
           id:0
         },
         {
           name:'trey',
           id:1
         },
         {
           name:'denzel',
           id:2
         }
       ],
       remove: function(id) { //items/2 ...
  • Function Interview Question

    Interview test questions

    function foo1()
    {
      return {
          foo: "GPS"
      };
    }
    
    function foo2()
    {
      return
      {
          foo: "GPS"
      };
    }
    console.log("foo1 returns:");
    console.log(foo1());
    console.log("foo2 ...
  • JS Oddities

    Check out some odd things with null

    console.log(null < 0)
     
    console.log(null <= 0)
     
    console.log(null == 0)
     
    console.log(null === 0)
     
    console.log(null >= 0)
     
    console.log(null > 0)
  • ScopePollution

    Try to figure this out

    var myObject = {
      foo: "myObject",
      func: function() {
        var self = this;
        console.log("outer func:  this.foo = " + this.foo); // myObject
        console.log ...
  • Scope Question

    Check it out and see if you know whats gonna happen

    var name = 'jason'
    
    function runNames() {
      console.log(name)
      var name = 'nick'
      console.log(name)
    }
    console.log(name)
    runNames()
    
  • Data Parser

    My use case here is i need a function that can try and parse anything the user passes in and sometimes that can be crazy stuff that would break other parse methods. so i used lodash to do alot of the heavy lifting then i created my own function to mixin.

    function Typpy(input, target) {
      if (arguments.length === 2) {
        return Typpy.is(input, target);
      }
      return Typpy.get(input, true);
    }
    Typpy.is ...
  • Api AI Youtube Integration #7 is the latest revision

    jQuery 3.0.0, HTML, CSS, JavaScript

    var accessToken = 'c200695729994831b5c3d17f1f4cfaa5'
    var baseUrl = 'https://api.api.ai/v1/'
    $(document).ready(function() {
      $('#input').keypress(function(event) {
        if (event.which ...
  • natural Numbers

    If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

    
    
    //If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5 ...
  • JS palindrome check #4 is the latest revision

    A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Allowances may be made for adjustments to capital letters, punctuation, and word dividers.

    function checkPalindrome(str) {
        return str.toLowerCase() == str.toLowerCase().split('').reverse().join('');
    }
    
    alert('Madam is a palindrome:'+ checkPalindrome('madam'))
    alert('sir ...