Keywords

Bnlang provides a rich set of keywords that can be used in three forms: English, Bangla, and Banglish.
All three map to the same meaning, so developers can code in the style they are most comfortable with.

Control flow

EnglishBanglaBanglishDescription
ifযদিjodiConditional branching.
elseনাহলেnaholeAlternative branch when condition fails.
switchবিকল্পbikolpoMulti-case branching.
caseঅবস্থাobosthaA specific branch inside a switch.
defaultঅন্যথায়onnothayDefault branch in switch if no case matches.
forপ্রতিprotiStandard loop.
whileযতক্ষণjotokkhonLoop while condition is true.
doকরুনkorunDo-while loop, runs at least once.
breakথামুনthamunExit from loop/switch.
continueচলুনcolunSkip current loop iteration.
returnফেরতferotReturn from function.
throwনিক্ষেপnikkhepThrow an exception.
tryচেষ্টাceshtaStart of error handling block.
catchধরুনdhorunHandle an error/exception.
finallyঅবশেষেoboshesheCleanup block after try/catch.

Declarations / Classes

EnglishBanglaBanglishDescription
varচলকcholokDeclare a variable (function-scoped).
letধরিdhoriDeclare a block-scoped variable.
constধ্রুবকdhrubokDeclare a constant value.
functionফাংশনfankshonDefine a function.
classশ্রেণীshreniDefine a class.
extendsপ্রসারিতprosaritoExtend a class (inheritance).
superঅভিভাবকobhibhabokCall the parent class.

Operators / Type

EnglishBanglaBanglishDescription
typeofধরনdhoronGet the type of a variable.
instanceofউদাহরণ_হিসেবেudahoron_hisebeCheck if an object is instance of a class.
inমধ্যেmodhyeCheck if property exists in object.
ofএরerUsed in for...of loops.
voidফাঁকাfakaEvaluate expression without returning value.
deleteমুছুনmuchunDelete a property from object.

Async / Generators

EnglishBanglaBanglishDescription
awaitঅপেক্ষাopekkhaWait for an async operation.
asyncঅসমলয়osomoloyDeclare asynchronous function.
yieldউৎপন্ন_করুনutponno_korunYield value from generator.

Miscellaneous

EnglishBanglaBanglishDescription
thisএটিetiCurrent object context.
newনতুনnotunCreate a new instance.
withসাথেsatheExtend scope chain.
debuggerডিবাগারdibagarInvoke debugger breakpoint.
staticস্থিরsthirDefine static property/method in class.