📜  反应隐式返回 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:42.648000             🧑  作者: Mango

代码示例1
let App = () => {
  return ( // some code here )
    }
// when your function body has a { } ie. curly brackets, you have to explicit use the return keyword to return something 

let App = () => (
   // some code here. this will be auto returned
    )
// when your function body has ( ) ie. round brackets, the return is implicit. ie. whatever is in the curly braces will be returned automatically


reference https://www.youtube.com/watch?v=dZXpgP9ibf8 . check the thimestamp "no return keyword"