-1

I have never seen JavaScript written in this way (with a "randomword: function(){}"). What does this "randomword: function(){}" syntax actually do? Is this ECMA standards JS?

Excerpt of codiqa.ext.js below:

  init: function() {
    for(var type in this.types) {
      this.types[type].prototype.initType();
    }
  },

  refresh: function() {
    for(var x in this.instances) {
      this.instances[x].refresh && this.instances[x].refresh();
    }
  },

  callbackInit: function() {

  },
geoyws
  • 3,326
  • 3
  • 35
  • 47

1 Answers1

0

Sorry guys, the code snippet IS part of an object literal notation.

window.CodiqaControls = {
  define: function() {},
  register: function() {},
  init: function() {}
};

This is a duplicate question of Javascript 'colon' for labeling anonymous functions?

Question solved.

Community
  • 1
  • 1
geoyws
  • 3,326
  • 3
  • 35
  • 47