DEV Community

Discussion on: 1. let, const and ... var

 
islam profile image
Islam Sayed

Aha :)
So here is a place where var is still useful 😉

Thread Thread
 
qm3ster profile image
Mihail Malo • Edited

@adrianhelvik
Did you mean:

let error
try {
  await foo()
} catch (e) {
  error = e
}
expect(error.message).toMatch('foo') // you can use string literals if you don't have a complex RegEx