รหัสหลัก
// ไม่ว่าฟังก์ชันที่ระบุจะมีอยู่หรือไม่ isExitsFunction(funcName) { try { if (typeof(eval(funcName)) == "function") { return true; } } catch(e) {} return false;}//ไม่ว่าจะเป็น มีฟังก์ชันที่ระบุอยู่ ฟังก์ชันตัวแปร isExitsVariable(variableName) { ลอง { if (typeof(variableName) == "undef") { //alert("value is undefed"); //alert("ค่าเป็นจริง"); return true;เพื่อการตัดสินเพิ่มเติม โปรดดูที่บทความนี้: //www.VeVB.COm/article/67551.htm