Object oriented javascript

  • undifined
  • null
  • boolean
  • number
  • string
  • var BooleanValue="true";
    var NumericalValue = 123;
    var StringValue = "This is a string";

    document.write(typeof BooleanValue) //displays "boolean"
    document.write(typeof NumericalValue ) //displays "number"
    document.write(typeof StringValue ) //displays "string"

    function objFunc {
    return 5;
    }
    var newObj = new objFunc();
    doucment.write(typeof objFunc); // displays "number" if in quotes "string"

    Attaching a property to the object (newObj3)

    function objFunc3(){
    }

    var newObj3 = new objFunc3();
    newObj3.StringValue = "This is a String";
    document.write(newObj3.StringValue); // displays "This is a String"