how to remove this paranthesis () from this text value (123) : how to remove this paranthesis ()  from this text value (123)and make it as integer as i want to use this repeatedly in my code how to optimise this for math calculation
i tried with below code but its not working 
       

        var num1 = "(123)";
        var num2 = "(321)";
        value = checkIntegerValue(num1,num2);
        

        function checkIntegerValue(num1,num2){
	           num1 = num1.replace(/\(|\)/g,'');
	           num2 = num2.replace(/\(|\)/g,'');
	           if(parseInt(num1) && parseInt(num2)){
	              return parseInt(num2-num1);  	
	           } 
        }
