R
R
Ruslan2021-06-11 04:53:01
JavaScript
Ruslan, 2021-06-11 04:53:01

Function work?

Please tell me why in the code below in the console it will display an error

let a = [1,2]

(function () {console.log(a)})();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2021-06-11
@Romario5891

That's clearer ? Stop trying to save on semicolons
let a = [1,2](function () {console.log(a)})();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question