Is there a JavaScript equivalent of the Python pass statement that does nothing?

前端 未结 9 843
感情败类
感情败类 2021-02-06 20:02

I am looking for a JavaScript equivalent of the Python:

pass statement that does not run the function of the ... notation?

Is the

9条回答
  •  天命终不由人
    2021-02-06 20:35

    you could create a function that actually does nothing.

    const pass = t => t
    
    try {
      pass()
    } else {
      console.log('helloworld!')
    }
    

提交回复
热议问题