What does ~fs.readdirSync mean in config files?

This question already has an answer here:

  • What does a tilde do when it precedes an expression? 6 answers

  • ~ is the bitwise NOT operator NOT. Every bit in x is inverted in ~x . For instance:

     x = 00011011
    ~x = 11100100
    

    Alternatively, it is equivalent to doing XOR with 0xFFFFFFFF (all 1-bits):

         00011011
     XOR 11111111
         --------
       = 11100100 
    
    链接地址: http://www.djcxy.com/p/75044.html

    上一篇: 到底做什么?

    下一篇: 〜fs.readdirSync在配置文件中的含义是什么?