38 / CODE
TECHNICAL EXAMPLE
01const targetDepth = 24;
02const tolerance = 0.3;
03
04function isWithinTolerance(actualDepth) {
05 return Math.abs(actualDepth - targetDepth) <= tolerance;
06}
07
08const measurement = 23.8;
09const status = isWithinTolerance(measurement)
10 ? "PASS"
11 : "RECHECK";
12
13// Result: PASS
14console.log(status);
ПОЯСНЕНИЕ
Подсветка должна помогать читать пример, а не имитировать полноценную IDE. Выделенные строки показывают место, где происходит основная логика проверки допуска.
ROLE / CODE EXAMPLE
LANGUAGE + FILE + LINE NUMBERS