Any JavaScript Developers (MREN Stack, PREN Stack) out there? If so, raise your hand 🤫
These days, JavaScript as a Language plays a role in a huge part of Software Development. On the Front-End there are tons of JS Frameworks (Vue, Angular, NextJS, etc) and JS Libraries (React, SwiperJS, jQuery, etc), and on the Back-End people easily put lots of Frameworks (Nest, Node, Express etc) and Libraries to work in their own areas too. But here's the thing: no matter how many Frameworks and Libraries there are, if you skip past the JavaScript Basics and keep writing and using them without a solid Foundation, you won't last in the long run.
Today I'm sharing Part 1 of (11) JavaScript Shorthand Code patterns to help make your JavaScript Fundamentals stronger. The idea behind the keyword Shorthand will probably be new to Beginners.
So what is a Shorthand?
To put it simply, Shorthand is a way of writing that takes bloated Code Lines and makes them as short as possible. You need to know these styles, and you need to know how to actually use them too. That's how the Code you write stays compact.
Converting types
Declaring several variables at once
Default values with ||
Powers of ten with 1e3
Object property shorthand
Arrow functions
Template literals
Finding an item with find()
Merging objects with spread
Object literals
Checking several values with includes()
One last thing I want to say: no matter how short you make your Code with Shorthands, it'll never be as short as your girlfriend's temper with you :3
Just kidding. I hope this was helpful
See you in the next one 😉
JavaScript Developer (MREN Stack, PREN Stack) လေးတွေရှိလားခင်ဗျာ၊ ရှိရင်လက်ညိုးထောင် 🤫
ဒီကနေ့ခေတ်မှာတော့ JavaScript Language ရဲ့အခန်းကဏ္ဌက Software Development ပိုင်းတော်တော်များများမှာအသုံးချရေးသားနေကြပါပြီ။ Front-End ပိုင်းမှာလည်း JS Framework (Vue, Angular, NextJS, etc) , JS Library (React, SwiperJS, jQuery, etc ) များစွာရှိသလို Back-End မှာလည်း Framework(Nest, Node, Express etc) , Library များစွာကိုလည်း သက်ဆိုင်ရာကဏ္ဏအလိုက် လွယ်လွယ်ကူကူအသုံးချရေးနေကြပါတယ်။ ဒီနေရာမှာ တစ်ခုရှိတာက Framework,Libraryတွေ ဘယ်လောက်ပဲပေါများပေါများ JavaScript Basic အခြေခံတွေကို ကျော်လွှားပြီး Foundation မခိုင်ဘဲရေးနေ၊ အသုံးပြုနေပြီဆိုရင်ရေရှည်ရပ်တည်နိုင်မှာမဟုတ်ပါဘူး
ဒီနေ့မှာတော့ ကျွန်တော်က JavaScript Fundamental ပိုင်းပိုခိုင်မာလာစေဖို့ JavaScript Shorthand Code (11) မျိုး Part-1 ကို မျှဝေပေးသွားမှာဖြစ်ပါတယ်။ Shorthand ဆိုတဲ့ keyword သဘောသဘာဝကို Beginner အတွက် စိမ်းနေပါလိမ့်မယ်။
ဆိုတော့ Shorthand ဆိုတာဘာလဲ?
Shorthand ဆိုတာက နားလည်လွယ်အောင်ပြောပြရမယ်ဆိုရင် ဖောင်းပွနေတဲ့ Code Line တွေကို အတိုဆုံးဖြစ်အောင် ရေးသားတဲ့ရေးနည်းရေးဟန်ဖြစ်ပါတယ်။ အဲဒီရေးနည်းရေးဟန်တွေကိုလည်းသိထားဖို့လိုအပ်သလို အသုံးချရေးတတ်ဖို့လည်းလိုအပ်ပါတယ်။ ဒါမှသာ ကိုယ်ရေးတဲ့ Code က ကျစ်လျစ်နေမှာဖြစ်ပါတယ်။
Converting types
Declaring several variables at once
Default values with ||
Powers of ten with 1e3
Object property shorthand
Arrow functions
Template literals
Finding an item with find()
Merging objects with spread
Object literals
Checking several values with includes()
နောက်ဆုံးအနေနဲ့ ပြောချင်တာကတော့ ဘယ်လောက်ပဲ Shorthandတွေကိုသုံးပြီး Codeတွေကို အတိုဆုံးဖြစ်အောင်ရေးနိုင်ရေးနိုင် "သင့်ကောင်မလေးရဲ့ သင့်အပေါ်အူအတိုဆုံး" ဖြစ်တာကိုတော့မှီမှာမဟုတ်ပါဘူး :3
စတာပါ။ အထောက်အကူတစ်ခုခုရသွားမယ်လို့မျှော်လင့်ပါတယ်
နောက်တစ်ပုဒ်နဲ့ပြန်တွေ့ကြတာပေါ့ 😉

