Its part of an exercise and the task is:
- If the first arg is only the url, then return the url + the second arg (which is a id number) //that works in my code
- If the first arg (url) includes already the id-then exchange that Id with the second arg(Id) -for example http://www.google.com?ID=111becomeshttp://www.google.com?ID=222
My code is wrong, happy about suggestions!
var first = "http://www.google.com?ID=111";
var second = "ID=222";
function searching(){
    var update="";
    if (arguments[0]==/^\w+@\w+\.com$/i){
        return arguments[0]+"?"+arguments[1];
    }
    else {
        update=arguments[0].match(/(\w+@\w+\.com) \?\w+\d/i);
    }
    return update + "?" +arguments[1]; 
}
searching(first, second);
 
     
     
     
    