2const { expect } = require('chai');
3
4describe('Contract1', function () {
5 let contract; 6
7 beforeEach(async function () {
8 contract = await Contract1.new();
In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement. For example, in the following code, foo
is initialized during declaration, while bar
is initialized later.
var foo = 1;
var bar;
if (foo) {
bar = 1;
} else {
bar = 2;
}
function foo() {
var bar;
let baz;
}
function foo() {
var bar = 1;
let baz = 2;
const qux = 3;
}