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

前端 未结 9 660
感情败类
感情败类 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:50

    use //pass like python's pass

    like:

    if(condition){
       //pass
    }
    

    This is equivalent to leaving the block with nothing in it, but is good for readability reasons.

    reference from https://eslint.org/docs/rules/no-empty

提交回复
热议问题