I'm trying to figure out a way of handling numbers larger than $1.79 \times 10^{308}$ in Javascript. The method I'm attempting is to store numbers as their base-10 logarithms, as that would allow me to write them as
Math.pow(10, num % 1) + "e+" + Math.floor(num)
However, I can't seem to find a way to correctly add and subtract numbers that are stored this way. Multiplication and division aren't a problem, because
$\log_{10}(xy) = \log_{10}(x) + \log_{10}(y) \\ \log_{10}(\frac xy)=\log_{10}(x)-\log_{10}(y)$
Neither is exponentiation, as
$x^y = 10^{y(log_{10}(x))}$
Addition and subtraction are the two operations I can't figure out a concrete solution for. I did some calculations to help myself out with this (plugging in two random numbers for the variables), and I found out
$log_{10}(14)+log_{10}(\frac {14+5}{14})=log_{10}(14+5)\Rightarrow log_{10}(19)$
Though, I'm not sure whether or not this will work with any two values, mainly because it requires taking 10 to the power of the logarithms, which will cause the function to return Infinity if either of them is greater than 308.25.
Is there any other method I can use to get a value $n$ such that $log_{10}(x)+n=log_{10}(x+y)$?

After digging around and trying all sorts of methods, I found one that worked.
$\text{let } d = \log_{10}(y) - \log_{10}(x) \\ \log_{10}(x+y)=\log_{10}(x) + \log_{10}(1+10^{d})$