[main.js] Add "position" function