// Define the method that we prototyped function verifyTEXT(){ // Check to see if the type property we added is set to a valid value if(this.type == "text"){ return true; }else{ return false; } } // Create a new property and method of the Connection object. File.prototype.type = null; File.prototype.isText = verifyTEXT; // Initialize a file var myLog = new File("/data/logs/today.log"); // Open the file in read mode myLog.open("r"); // Using the prototype we defined, assign the type property myLog.type = "text"; // Check the type of the connection to see if it is valid if(myLog.isText()){ write(myLog + " has a valid type of " + myLog.type); }else{ write(myLog + " has an invalid type of " + myLog.type); }