Consider the following code:
<script>
alert`1` // outputs 1
</script>
or
<script>
function f($a) {
alert($a);
}
f`2`; // outputs 2
</script>
Why does JavaScript allow functions to be called using `` instead of ()
?
References like https://www.w3schools.com/jsref/jsref_operators.asp mentions nothing about the use of ``.
Can `` also be used to call functions that take more than 1 argument? If so, how?