Internal Working of Javascript