id | keywords | name | summary | category | |
---|---|---|---|---|---|
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;