I am playing with vis.js and have worked out how to get an array of all the currently selected nodes.
var TempNodes = network.getSelectedNodes();
My problem is that the getSelectedNodes() array is returned with all the nodes id's in numeric order from lowest to highest...There doesn't seem to be a way to tell what the last selected node id was or what the first selected node id was. I can only tell which node id's were selected.
Does anyone know a way to be able to find out from the getSelectedNodes array, what was the first or last selected node id ?
Using the concepts tucuxi put forward, I did come up with some working code to achieve this. Although tucuxi's code did not work 'straight out of the box' his idea was sound and he deserves credit for it.
Here is the code that eventually worked for me