Lock.isValid()

NES3+Syntax

							lock.isValid()

Description

The isValid() method of the Lock object verifies if the lock was properly constructed. The method returns true if the lock was constructed successfully and false otherwise.

Example

Listing 8.94 shows how you can check if a lock was properly constructed with an if statement.

Listing 8.94 Verifying a Lock with the isValid() Method
<SERVER>

// Create a new Lock object
var myLock = new Lock();

// Verify the lock
if(!myLock.isValid()){
  write('There has been an error constructing your lock');
}else{

  // Success: perform operations here
}

</SERVER>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.