Rearrange string to an anagram of the string - get new position, old position values
You can simplify the logic by setting each character you find in target to NULL. I also like to use a "while" loop as shown below.

function _get_new_positions(source, target) {
    var transform = [], i, j, found, want;
// convert both strings to arrays - uppercase so we can find the destination without worrying about cases
    source = source.toUpperCase().split('');
    target = target.toUpperCase().split('');
    for(i=0; i&lt;source.length; i++) {
        j = 0;
        found = false;
        want  = source[i];
        while((j &lt; target.length) &amp;&amp; !(found = (target[j] == want))){j++}
        if (! found) {
            console.log("Cannot find character: " + want + " at [i]: " + i);
        } else {
            console.log("Found character: " + want + " at [i,j]: " + i + j);
            target[j] = ''; //blank out the character for future searches
            transform.push([i,j])
        }
    }
    return transform;
}