Null Coalescing Operator (??) : Null? ???? ???? ?? ??
Aug 01, 2025 am 07:45 AMNULL COOLESCING ??? (??)? NULL ?? ???? ?? ?? ?? ? ? ???? ???? ??? ??? ?????. 1. ?? ????? ? ?? ???? ?? ?? ?????. ??? ??? ??? ????? ?????. 2. ??? ?? (||) ???? ?? ?? "", 0 ?? false? ?? ?? ?? ???? ? ?? ???? ?? ?? ? ??????. 3. ???? ?? ???? ?? ?? ??, ?? ??, API ?? ? ??? ?? ??? ?????. 4. ??? ????? : value1 ?? value2 ?? value3? ? ?? ? ? ?? ?????. 5. ?? ??? ????? - C#? ?? ??? ????, PHP? ???? ?? ?? ??? ????, JavaScript? NULL ? ???? ?? ?? ???? ?????. 6. ??? ?? ??? && ?? ||? ?? ? ? ??? ?????. ?? ?? ??? ??? ?? ? ??? ???? ? ???? ?? ??? ??? ??? ||?? ?????. ??? ? ?? ??? ??? ?? NULL ?? ???? ?? ? ????? ??? ???? ?? ???? ???? ??????.
??
Null Coalescing Operator? ??? ???? C#, PHP, JavaScript (ES2020 ??)? ?? ???? null
?? ???? ???? ???? ?????. ????? null
?? undefined
???? ?? ? ?? ??? ??? ????? ?? ???? ??? ? ?? ?? ??? ?? ?????.

Null Coalescing ?????? ?
??
???? ?? ????? null
?? undefined
?? ?????. ??? ??? ??? ????? ?????.
??? ?? = userInput ?? "??";
? ??? :

-
userInput
null
?? ??name
userInput
? ?? ????. -
userInput
?null
? ??name
????"Guest"
? ?????.
??? ????? ??? ????.
??? ?? = userInput! = null? userInput : "???";
??? ? ?? ???? ??? ???? ????.

? Ternary ?? ?? (||)?? ?? ??
JavaScript? ???? ??? ??? ?? ( ||
) ???????.
const name = userInput || "??";
??? ?? ???? ????. ||
null
?? undefined
??? ""
, 0
, false
, NaN
)? ?? ??? ??????.
const userInput = ""; const name = userInput || "??"; // "Guest"? ????? - ???? ??? ?? ????!
? ?? ??
, null
?? undefined
?? ??? ? :
const name = userInput ?? "??"; // ?? "" - ? ???? ?????
??? null
? ????? ?? ??? ????? ??
? ???? ?????.
?? ?? ??
??? ???? ????? ???? ??
Shines :
- ?? ?? ?? ?? (???? ???)
- ?? ??
- API ?? ??
- ??? ?? ??
?? ?? C#?? :
int timeout = config.timeout ?? 30;
?? PHP?? :
$ teme = $ _session [ '??'] ?? '?';
??? ?? ?? ??? ? ? ???? ??
??? :
String displayName = user.providedName ?? user.username ?? "???";
??? ????? ????. "??? ??? ??????. ??? ??? ??? ??? ??????. ??? ??? ????? ????."
??? ?? ??
- C# ,
??
?? ? ?? ? ?? ??? ?? ?????. - PHP ??? ???
null
?? ??? ????? ????? (??? ???? ??? ??? ???? ?????=
). - JavaScript ??
??
null
?undefined
?? ?????.0
,false
?""
?????.
?? ??? ?? ??? ?????. ??
???? ????? ?? ??? ???? &&
?? ||
? ?? ? ? ??? ????. :
const result = (value ?? defaultValue) && isactive;
??
Null Coalescing Operator? ?? ?? ?? ? ??? ? ???? ??? ? null
?? ??? ?????. null
? undefined
?? ??? ??? ??? ??? ??? ??? ????. ?? ??? ???? ??
, ??? ||
? ?? ? ???? ??? ??????? ?? ????.
????? : ?? ??
“??? ?? ? ?? ??”??? ??? ?? -“??? ?????”? ????. ?? ???? ? ??? ??? ??? ??????.
? ??? Null Coalescing Operator (??) : Null? ???? ???? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

== ?? === ??? PHP ?? ?? ??? ??? ?????. == == ??? ?? ??? ???? === ?? ??? ??? ???? ??? ??? ?????. ?? ??, 0 == "false"? true??? 0 === "false"? false??? 0 ? ??? ?? ?, ? ??? ?? ??? ?? ? ?? ??? ??? ???? ? ???????.

??? ????? regluceReadibility; useif-elsechainsinstead.2.don'tuseternariesforsideffects likefunctscalls; useif-elseforcontrolflow.3.skipternieswithcomplexpessionsinvollingLongStringsorlogic; breakthemintovariables.4.avoid

whenUllCoalescingOperator (??)? ?? hondlorUndefined.1.ItreturnsTheleftOperAndifitisnOtnullORundefined; ??? ???, itreturnsTherightOperand.2.unlikethelogicalor (||) ???,?

PHP? ?? ?? ??? ?? ?? ?? ?? endif ? endfor? ?? ?? ? ???? ???? ?? HTML? ???? ???? ? ????. 1. if-elseif-else? ???? ???? endif? ??? ?? ??? ? ?????. 2. Foreach? ??? ???? ????? ? ?? Endforeach? ??? ?? ???? ?????. 3. ?? ???? ?? ??, ??? ?? ?????. ? ????? ???? ??? ??? ????. ?? ?? ??, ??? ?? ? HTML ?? ??? ?????. ??? ??? ??? ?? Curly Braces? ??? PHP ??? ?? ????????. ??? PHP? HTML? ???? ?? ?? ?? ???? ????? ????? ?? ??? ?????.

AlwaysUseStricTequality (=== ?! ==) injavaScriptToaVoidUnexpectedBehaviorfromTypecoercion.1.looseequality (==) canLeadTocounterIntuitVeresultSbecAuseItPerformStypeConversion, Making0 == false, ""== ??, "== 1, undeLalltue.2

useGuardClaUsestorEturnearlylylyly ? flattenstructure.2. ExtractComplexConditionScriptiveFunctionSorvariblesforClarityandReus.3

??? ??, ???? ??? ? ?? ??? ?? ??? ??? ????. 1. ??? ???? ???? ??? ?? ???? O (n)?? ?? ????? ??? ?? ???????. 2. ??? ???? ????? ?? O (1) ??? ?? ?? ? ?? ?? ?? ? ?? ??? ??? ? ?? O (1)? ?? ???? ??? ? ? ????. 3. ?? ??? ?? ?? ??? ???? ?? ??? ???? ? ????. 4. ?? ??, ??? ??, ? integer ?? ?? ? ?? ??? ??? ?, ? ????? ??? ????? ??; 5. ?? ?? (? : C/C, Java, JavaScript, C#)? ???? ??? ??? ???? ?? ???? ?? ????????. SWI? ?? ???????

?? && toskipexpensiveoperationsandguardagainstnull/undefinedby-short-circitingonfalsyvalues; 2.use || tosetdefaultseffiled, butbewareittreatsallfalsyvalues (like0) asinvalid, soprefer ?? fornull/undefinedonly;
