# What does the exclamation mark do before the function?

i"m a newbie to javascript... please let me know what does this exclamation is for?

!function () {}();

You can declare a function the following way

function one() {}

Note that there's no semicolon in this function declaration; you need a separate invocation of one() to run the function.

On the other hand, !function one() {} is an expression, but it still doesn't invoke the function, but we can use !function one() {}() to do that, as () has higher precedence than !. The original example function doesn't need a self-reference so that the name then can be dropped.

So what the author is doing is saving a byte per function expression; a more readable way of writing it would be this:

(function(){})();
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4626027047634125, "perplexity": 1153.218554020331}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-39/segments/1505818690035.53/warc/CC-MAIN-20170924152911-20170924172911-00165.warc.gz"}