المرجع المنطقي لجافا سكريبت
منطقية جافا سكريبت
يمكن أن تحتوي قيم JavaScript المنطقية على قيمتين: true
أو
false
.
الدالة المنطقية ()
يمكنك استخدام Boolean()
الوظيفة لمعرفة ما إذا كان التعبير صحيحًا:
مثال
Boolean(10 > 9)
أو حتى أسهل:
مثال
(10 > 9)
10 > 9
للحصول على برنامج تعليمي حول القيم المنطقية ، اقرأ برنامج JavaScript Boolean التعليمي .
طرق JavaScript المنطقية
Method | Description |
---|---|
toString() | Converts a boolean value to a string, and returns the result |
valueOf() | Returns the primitive value of a boolean |
خصائص JavaScript المنطقية
Property | Description |
---|---|
constructor | Returns the function that created JavaScript's Boolean prototype |
prototype | Allows you to add properties and methods to the Boolean prototype |