14 AnswersNew Answer
The only way to write the function "print" without parenthesis is to use a lambda function. This only works when there is a single argument for the function. If there is more than one argument they must be placed in parenthesis and separated by commas. Even after all that you still have to call the function using parenthesis... //single argument const print = x => x - y; print1 = print; console.log(print1(3)); //multiple arguments const print = (x, y) => x - y; print1 = print; console.log(print1(3, 7)); This is a contrived and obfuscated use of lambda functions and has no value whatsoever in demonstrating the use of lambda functions or good coding practices. If you are going to call a function after defining it there is no point in using a lambda function. "Any fool can write code a computer can understand. Good programmers write code that humans can understand." -- Martin Fowler
Why ask a question with an obvious answer?
Vasiliy Obvious question? I suppose you have an obvious answer?
Vasiliy Already done
I didn't get your question ... Do you want to call print1() or print() ??? * The snippet in Description had been modified from the original.
Ipang I'm surprised that you don't have it. 😕
Vasiliy That means you do then?
Ipang I do not know English well and did not understand your question, reformulate the question.
Vasiliy You said you were surprised I don't have any answer to the OP's question. Do you have the answer?
It's written as const print1 = x => x - 7;
Aniket Use of arrow function may help const print = ( x ) => x - 7; let print1 = print; console.log( print1( 49 ), print( 49 ) );