code: def set_as_object(self, index = None, value= None):
          
          if index == None and value != None:
              self.set_as_array(value)
          else:
              self[index] = value
docs: Sets a new value to array element specified by its index.
          When the index is not defined, it resets the entire array value.
          This method has double purpose because method overrides are not supported in JavaScript.
  
          :param index: (optional) an index of the element to set
  
          :param value: a new element or array value.