<
) قيم رقمين. إذا كان الرقم إلى اليسار أقل من الرقم إلى اليمين ، فسيعود إلى الحالة true
. خلاف ذلك ، فإنها ترجع false
. مثل المشغل المساواة ، أقل من المشغل يحول أنواع البيانات أثناء مقارنة. أمثلة 2 <5 / صحيح
"3" <7 // صحيح
5 <5 // خاطئة
3 <2 // false
"8" <4 // كاذبة
less than
المشغل إلى الخطوط المشار إليها بحيث تكون عبارات العودة منطقية. testLessThan(0)
"تحت 25"
testString: 'assert(testLessThan(0) === "Under 25", "testLessThan(0)
should return "Under 25"");'
- text: يجب أن ترجع testLessThan(24)
"تحت 25"
testString: 'assert(testLessThan(24) === "Under 25", "testLessThan(24)
should return "Under 25"");'
- text: يجب أن ترجع testLessThan(25)
"تحت 55"
testString: 'assert(testLessThan(25) === "Under 55", "testLessThan(25)
should return "Under 55"");'
- text: يجب أن ترجع testLessThan(54)
"تحت 55"
testString: 'assert(testLessThan(54) === "Under 55", "testLessThan(54)
should return "Under 55"");'
- text: testLessThan(55)
إرجاع "55 أو أكثر"
testString: 'assert(testLessThan(55) === "55 or Over", "testLessThan(55)
should return "55 or Over"");'
- text: يجب أن ترجع testLessThan(99)
"55 أو أكثر"
testString: 'assert(testLessThan(99) === "55 or Over", "testLessThan(99)
should return "55 or Over"");'
- text: يجب عليك استخدام <
المشغل مرتين على الأقل
testString: 'assert(code.match(/val\s*<\s*("|")*\d+("|")*/g).length > 1, "You should use the <
operator at least twice");'
```