js traversal deleted object key

// If the user does not fill in the value, key object is deleted.
Object.keys(obj).forEach( (key) => {
     if (! obj [key]) {//! obj [key] is represented as false, the value is determined to empty false.
           delete (obj [key]) // delete the object key.
     }
})

Guess you like

Origin www.cnblogs.com/ljy-/p/12047970.html