How to use a return value in another function in Javascript?

前端 未结 6 885
傲寒
傲寒 2020-12-03 02:02

I\'m self-teaching myself JavaScript and out of curiosity I\'m wondering what is the proper way of returning a value from one function to be used in another function. For ex

6条回答
  •  长情又很酷
    2020-12-03 02:29

    To copy the return value of any javascript, we can use inbuilt copy() method.

    you can use any expression, function, etc find some examples below

    1. using expresseion

    a = 245; copy(a);

    1. using function
    a = function() {
      return "Hello world!"
    }
    copy(a());
    

    Official Doc for reference

提交回复
热议问题