If it is the basic JavaScript split function, look at documentation, JavaScript split() Method.
Basically, you just do this:
var array = myString.split(' -- ')
Then your two values are stored in the array - you can get the values like this:
var firstValue = array[0];
var secondValue = array[1];