Created
March 2, 2022 00:02
-
-
Save alecat88/457361fb395fb0c121c4623ae4310b12 to your computer and use it in GitHub Desktop.
ES12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the example, the &&= will check if the filesCount is true. | |
// If true, then the right value will be assigned to the left variable. | |
let myFiles = {filesCount: 100, files:[]}; | |
myFiles.filesCount &&= 5; | |
console.log(myFiles); // This will print: {filesCount: 5, files: Array(0)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment