// options
if (options) {
this.deep = !!options.deep
this.user = !!options.user
this.lazy = !!options.lazy
this.sync = !!options.sync
} else {
this.deep = this.user = this.lazy = this.sync = false
}
Während ich vue.js Watcher zu verstehen versuchte, sah ich diese Syntax !!options.deep
here ich total verstehen, was !
Mittel, aber warum sollte jemand !!true
verwenden, weil es Sie geben true
wieder.Warum sollte jemand !! in Javascript?
Dank
Ja '' true' ist 'true', aber dann ist' '1' und' !! "hallo world" '. – Pointy