0
can i write this function without brackets in variable?
function print(x) { return x-7 } var print1=print console.log(print1(3))
14 odpowiedzi
+ 2
Why ask a question with an obvious answer?
+ 2
Vasiliy
Obvious question?
I suppose you have an obvious answer?
+ 2
Vasiliy
Already done
+ 1
Ipang print1
0
I didn't get your question ...
Do you want to call print1() or print() ???
* The snippet in Description had been modified from the original.
0
Ipang
I'm surprised that you don't have it. 😕
0
Vasiliy
That means you do then?
0
Ipang
I do not know English well and did not understand your question, reformulate the question.
0
Vasiliy
You said you were surprised I don't have any answer to the OP's question.
Do you have the answer?
0
Ipang open javascript and make sure the Aniket Ganguly code works.
- 1
Aniket
Use of arrow function may help
const print = ( x ) => x - 7;
let print1 = print;
console.log( print1( 49 ), print( 49 ) );