title: is this a function or an object being returned?
body: <pre><code>const {sum, subtract} = require('./math')
  
  
  
  let result, expected
  result = sum(3, 7)
  expected = 10
  expect(result).toBe(expected)
  
  
  function expect(actual) {
    return {
      toBe(expected) {
        if (actual !== expected) {
          throw new Error(`${actual} is not equal to ${expected}`)
        }
      },
    }
  }
  </code></pre>
  
  <p>is toBe{...} and object or a function? </p>
  
  <p>It is used as a function when you call expect(result).toBe(expected).However, in the expect function definition it looks like an object because it doesn't have a function keyword. However objects do not accept parameters. Thank you in advance.</p>