Salve a tutti! Premetto che ho iniziato a programmare in Javascript da poco. Sto cercando di realizzare uno slider che visualizzi la stringa corrispondente all'input dell'utente. Quest'ultimo viene utilizzato come indice per un array che contiene le suddette stringhe. Ho scritto il seguente codice:


codice:
function Obj( options ) {

this.opz1 = options.opz1;
this.opz2 = options.opz2;
this.data = options.data;   // this.data è un array di stringhe..

this._getString = function( val ) {   

  return 'Value: ' +this.data[val].label;
};

this.init = function () {

  var sliderCfg = {

    position: 'position!',
    printValue: this._getString,   // la funzione che l'oggetto slider utilizzerà per la stampa delle stringhe..
    width: '300px'
  };

  var slider = new Slider( sliderCfg );

  };

  this.init();
}

var a = new Obj( opz );

La prima a darmi errore è proprio il metodo _getString ( non riesce ad accedere all'array ). Mi scuso se ho scritto delle banalità, ma come dicevo sto ancora imparando. Qualche suggerimento?