Jump to content

kristian@ktae.co.uk

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by kristian@ktae.co.uk

  1. 11 hours ago, Ingolme said:

    The reason most tutorials don't teach it is because it is usually bad practice to use it.

    The "with" keyword takes the properties and methods of an object and treats them as variables inside the braces. For example:

    
    var obj = {
      x : 5,
      y : 10
    };
    
    with (obj) {
      alert(x + " , " + y);
    }

     

    Thanks, I realise it is bad practice.
    However, I have found some articles explaining when it is useful.
    So, you are saying it was deliberately excluded.

×
×
  • Create New...