Vice versa.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Vice versa..

If I have, this function: function f(){return "text";} And wanted to make a function that writes (Print) what 'f' returns , I will type: function f(){return "text";} function ff(){document.write( f() );} But....What if I wanted to make a function that returns what another function writes? That is: function f(){document.write( "text" );} function ff(){ ...... return ...... ;} Is there a method?

24th Mar 2022, 9:37 AM
Eyad Al-Ahmar
Eyad Al-Ahmar - avatar
1 Answer
+ 1
What is your plan in relation to this? I just thought it's redundant when a function prints something and return that something as well. Because if it returns that something, then the something (that was returned) can be printed elsewhere. Maybe you can improve your chances for answers if you add more context on this thoughts ...
24th Mar 2022, 10:46 AM
Ipang