Use of semicolon in javascript

in the problem

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/import-a-default-export

my code

"use strict";
import subtract from "math_functions"
subtract(7,4);

this runs correctly without use of semicolon

but in the previous problem

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file

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