mrkiyak mrkiyak - 4 months ago 35
Javascript Question

using dot notation with more than one in javascript syntax

Could you please explain whats the mean of

first[dot]second like declaration in javascript rules

first.second = (function () {


it means first is an object and second is a property of that object.

it can be defined as follows too;

var first = {};// {} -is JS object notation
first.second = function(){

var first = {
  second : function(){

//invoke the function
first.second();// prompt alert message

simple documentation