JSFiddle

  • Var/Func Hoisting

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

    var a = 1; 
    function b() { 
        a = 10; 
        return; 
        function a() {} 
    } 
    b(); 
    console.log(a);          
            
  • Palindrome

    check Palindrome

    function checkPalindrome(str) {
        return false
    }
    
    console.log('Madam is a palindrome:'+ checkPalindrome('madam'))
    console.log('sir is a palindrome:'+ checkPalindrome ...
  • Lodash Filter Entries

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

    var entries = [{
      '.tag': 'folder',
      name: 'addd',
      path_lower: '/peeps/dad/addd',
      path_display: '/peeps/dad/addd',
      parent_shared_folder_id: '52130910',
      id: 'id:pt8S9nR0uAAAAAAAAAACIQ',
      client_modified ...
  • Natural Numbers

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

    
    //If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5 ...
  • 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()