国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

node.js - When I was learning typescript to write the node interface, I was confused when I saw a piece of code. Guys, please give me the answer.
PHP中文網
PHP中文網 2017-06-10 09:47:59
0
1
912

This is Microsoft’s official code https://github.com/Microsoft/...
During the learning process, I saw this bit operator (&) code and said I couldn’t understand it. Can you give me an answer? What is the meaning of this code?
Thank you.
type UserModel What type is this defined?
Also, mongoose.Document & {} returns 0 or 1? But in the case of {}&{}, all returns are 0, right?
Rookies don’t really understand.

PHP中文網
PHP中文網

認證高級PHP講師

reply all(1)
滿天的星座

In typescript, the & operator is used between two types to represent cross types, instead of the & bit operation of js

Cross type can be simply understood as a type that has all members of multiple types at the same time

For example, in the code in the picture, the type UserModel has all the members of mongoose.Document and all the members defined in {} later

See the official documentation here

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template