"Almost Equal" in Jasmine
<p><strong>The Story:</strong></p>

<p>In Python built-in <code>unittest</code> framework, there is an "approximate equality" assertion implemented via <a href="https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual" rel="noreferrer"><code>assertAlmostEqual()</code></a> method:</p>

<pre><code>x = 0.1234567890
y = 0.1234567891
self.assertAlmostEqual(x, y)
</code></pre>

<p>Which has the number of decimal places to check configurable.</p>

<p>And, there is a <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.testing.assert_almost_equal.html" rel="noreferrer"><code>numpy.testing.assert_almost_equal()</code></a> which also works for the arrays of floats:</p>

<pre><code>import numpy.testing as npt
import numpy as np

npt.assert_almost_equal(np.array([1.0,2.3333333333333]), np.array([1.0,2.33333334]))
</code></pre>

<p><strong>The Question:</strong></p>

<p>How to make an "almost equal" assertion <em>in JavaScript/Jasmine</em> for floats and array of floats?</p>