I can not do aggregation with JavaScript.
For example:
This is working: (Decrease)
var mevcutID = getParameterByName('id');
var newPageID = currentID - 1;
window.location.replace("https://helloWorld.com/page?id=" + newPageID);
## return: https://helloWorld.com/page?id=4
This is NOT working: (Addition)
var mevcutID = getParameterByName('id');
var newPageID = currentID + 1;
window.location.replace("https://helloWorld.com/page?id=" + newPageID);
## return: https://helloWorld.com/page?id=51
What is the reason of this?
You need to coerce currentID to an number. Right now it's a string and you're appending 1 as a string.
var newPageID = +currentID + 1;