Use of semicolon in javascript

in the problem

my code

"use strict";
import subtract from "math_functions"

this runs correctly without use of semicolon

but in the previous problem

my code

import * as yoo from "capitalize_strings"
"use strict";

this does not run,if i place semicolon at end then it runs.

i don’t understand how semicolon is used in js.i have declared many functions in js without semicolon and it works well.

In the FCC challenges you’re writing code to pass a small set of tests, some of which tests the actual text looks a certain way to check if you’ve used things the challenge asks for. Some tests require semicolons due to how they have been written