Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 668 Bytes

specialvalues_line_of.mdx

File metadata and controls

38 lines (25 loc) · 668 Bytes
idkeywordsnamesummarycategory
line-of
line of
__LINE_OF__
This is the `__LINE_OF__` special value.
specialvalues

__LINE_OF__(expression) returns a tuple consisting of (line, expression), where line is the line number at which the expression you pass as a parameter here appears in the file.

Note: expression refers to any expression, it does not need to be a function.

<CodeTab labels={["ReScript", "JS Output"]}>

letf= () =>Nonelet (line, f') =__LINE_OF__(f) line->Console.logf'->Console.log
functionf(){}console.log(2);console.log(f);varline=2;varf$p=f;
close