javascript function:
//from javascript file1
   for(i=0;i<10;i++){
      setContent(i);
   }
//from javascript file2 where function is present
        setContent: function (content) {    
        var xy=0;
        xy = parseInt(xy + content);
        console.log(xy);
Above code is appending the content instead of adding
 
    