💡 สวัสดีจ้าเพื่อน ๆ วันนี้แอดจะพาเพื่อน ๆ มารู้จักกับ Operator จาก JavaScript ที่จะช่วยให้เพื่อน ๆ เข้าถึงข้อมูลใน Object ได้ง่ายมากขึ้น !!
.
🌈 และเจ้านี่คือ...Optional chaining (?.) นั่นเองจ้า จะเป็นยังไง มีรายละเอียด และวิธีการใช้งานยังไง ไปติดตามกันได้ในโพสต์นี้เลยจ้า ~~
.
✨ Optional chaining (?.) - เป็นตัวดำเนินการที่ทำให้เราสามารถอ่านค่าใน Object ที่ซ้อนกันหลาย ๆ ชั้นได้ง่ายมากขึ้น เขียนง่าย และทำให้โค้ดสั้นลงนั่นเอง
.
จริง ๆ แล้วมันก็เหมือนเราใช้ เครื่องหมายจุด (.) นั่นแหละ แต่ความพิเศษของมันก็คือถ้าในกรณีไม่มีค่าใน Object หรือ Function มันจะ Return เป็น Undefined แทน Error
.
👨💻 Syntax
.
obj.val?.prop
obj.val?.[expr]
obj.arr?.[index]
obj.func?.(args)
.
📑 วิธีการใช้งาน
.
❤️ ตัวอย่าง 1 : ใช้เข้าถึงข้อมูลใน Object
let customer = {
name: "Mew",
details: {
age: 19,
location: "Ladprao",
city: "bangkok"
}
};
let customerCity = customer.details?.city;
console.log(customerCity);
//output => bangkok
.
❤️ ตัวอย่าง 2 : ใช้กับ Nullish Coalescing
let customer = {
name: "Mew",
details: {
age: 19,
location: "Ladprao",
city: "bangkok"
}
};
const customerName = customer?.name ?? "Unknown customer name";
console.log(customerName); //output => Mew
.
❤️ ตัวอย่าง 3 : ใช้กับ Array
const obj1 = {
arr1:[45,25,14,7,1],
obj2: {
arr2:[15,112,9,10,11]
}
}
console.log(obj1?.obj2?.arr2[1]); // output => 112
console.log(obj1?.arr1[5]); // output => undefined
.
📑 Source : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
#javascript #optionalchaining #BorntoDev
同時也有12部Youtube影片,追蹤數超過44萬的網紅MakeLearningFun,也在其Youtube影片中提到,Programming become more and more important nowadays. Some people may think it is different to learn, but actually it is not! With the right tools and ...
「function return」的推薦目錄:
- 關於function return 在 BorntoDev Facebook 的最佳解答
- 關於function return 在 Sebrinah Yeo Facebook 的最佳貼文
- 關於function return 在 BorntoDev Facebook 的最讚貼文
- 關於function return 在 MakeLearningFun Youtube 的精選貼文
- 關於function return 在 Sweets Life by kurashiru Youtube 的精選貼文
- 關於function return 在 Sweets Life by kurashiru Youtube 的最佳解答
- 關於function return 在 Returning Multiple Values from a Function - JavaScript Tutorial 的評價
- 關於function return 在 12. Function return value types and void in Typescript ... 的評價
function return 在 Sebrinah Yeo Facebook 的最佳貼文
Lately with so many cases around, boosting up our immune is crucial! Am glad I have my solutions that works and do you know food also plays a part as well. That's why I opted to swap my regular fresh milk that we simply grab and go at the mart, to a more specific targeted nutrition that will give us extra benefits in return.
Like the ProVital Immuna Plus, the first adult nutritious milk, that is featuring its unique proposition that provide Triple Immunity Protection from yeast beta-glucan, selenium and vitamin C that strengthens the body’s immune function!
More deets on "Activate your Immunity, Activate your Life" on my web https://www.sebrinahyeo.com/2021/08/PROVITAL-Immuna-Plus-Malaysia.html
🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾🇲🇾
Also apart from this campaign, PROVITAL Immuna Plus would like to celebrate the admired efforts of local heroes via “Healthier Malaysians, Stronger Malaysia”, programme that aims to recognise, honour and celebrate ordinary Malaysians doing extraordinary things in making a difference in their communities today. We urge the public to join our efforts in showing our appreciation for inspiring Malaysians who have been championing a cause for the betterment of society by nominating them to be a Local Hero too.
The programme is now open to nominations. The public can nominate deserving Malaysians who have carried out activities or initiatives that serve or meet a community need. Nominations can be submitted via https://forms.gle/7mURUZrv5vrfHyPQ8 from 19 July 2021 until 8 August 2021 midnight. Each Local Hero will receive a one (1) year supply of PROVITAL Immuna Plus adult nutritious milk and have their stories featured on PROVITAL Immuna Plus’ digital platforms.
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
Music credits to :
Music: Early Hours
Musician: Ikson
function return 在 BorntoDev Facebook 的最讚貼文
🔥 มาเปลี่ยนการเขียนฟังก์ชันธรรมดา ให้สั้น และกระชับลง ด้วย Arrow Function กันเถอะ !!
.
👉 ซึ่งเจ้า Arrow Function คือ การสร้าง Function ในรูปแบบที่สั้นกระชับกว่าเดิมด้วยการใช้ “ () => ” นั่นเอง
.
📑 ตัวอย่าง
🔹 แบบธรรมดา
hello = function() {
return "Hello World!";
}
number = function(val) {
return "Number is: " + val;
}
sum = function(num1, num2) {
return "Sum is: " + (num1+num2);
}
🔸 Arrow Function
hello = () => "Hello World! ";
number = (val) => {
return "Number is: " + val;
}
sum = (num1, num2) => {
return "Sum is: " + (num1+num2);
}
.
ไปลองปรับใช้กับโค้ดของเพื่อน ๆ ดูน้าาา ใครมีอะไรเพิ่มเติมเกี่ยวกับเจ้า Arrow Function คอมเมนต์ไว้ด้านล่างได้เลย เผื่อจะเป็นประโยชน์กับเพื่อน ๆ คนอื่นนะ ❤️
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
function return 在 MakeLearningFun Youtube 的精選貼文
Programming become more and more important nowadays. Some people may think it is different to learn, but actually it is not! With the right tools and resources, we believe every one can learn programming!
In this video, we explain hello world c++ program in detail such as iostream,
cout, less than operators, end , main function and return value of the program.
We also demonstration how the compiler can help us and some experiments about the return value.
If you want to watch more video from us, please
-do subscribe us!
-like the video and share to you friend who have kid on the facebook, tweeter, google+....etc
how to learn math
https://www.youtube.com/playlist?list...
stem projects
https://www.youtube.com/playlist?list...
Anpanman Educational Toys
https://www.youtube.com/playlist?list...
Learn Shapes for kids
https://www.youtube.com/playlist?list...
Learn letter A to Z
https://www.youtube.com/playlist?list...
Learn names of fruits and vegetables
https://www.youtube.com/playlist?list...
Learning street vehicles names and vehicle sounds
https://www.youtube.com/playlist?list...
Learn names of animal with animal sound
https://www.youtube.com/playlist?list...

function return 在 Sweets Life by kurashiru Youtube 的精選貼文
※With subtitles※
The video has subtitles for how much and how to make it.
Please turn on the subtitles before viewing.
Kurashiru App
▼ iOS app
https://app.adjust.com/npk6jm1
▼ Android application
https://app.adjust.com/vz3y2u7
▼ Detailed instructions are published in the app.
https://www.kurashiru.com/recipes/ea3...
-------------------------------------------------- -------------------------------------------------- --------------------
[Material] 1 unit (15 cm diameter cake type)
400g cream cheese
60g sugar
3 beaten eggs (medium size)
[How to make]
Preparation. Let cream cheese return to room temperature. Preheat the oven to 170°C.
1. Put cream cheese in a bowl, mix with a whipper, add sugar little by little and mix until familiar.
2. Add beaten egg and mix until smooth.
3. Pour into a mold lined with cooking sheet, bake in an oven at 170°C for 45 minutes until brown, and remove from the mold when the heat is removed.
[Cooking Tips]
Be sure to bake the oven after it has been preheated.
If the oven does not have a preheat function, set the temperature, heat for 10 minutes, and then start baking.
There may be an error in the heating power depending on the model of the oven you are using and the years of use. Be sure to adjust the baking time as a guide.
If it burns too much, apply aluminum foil.
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■
This is a channel dedicated to sweets. The recipe is posted on kurashiru.
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■
Kurashiru App
▼ iOS app
https://app.adjust.com/npk6jm1
▼ Android application
https://app.adjust.com/vz3y2u7
Kurashiru SNS
▼ Twitter
https://twitter.com/kurashiru0119
▼ Instagram
https://www.instagram.com/kurashiru/? ...
▼ TikTok
https://www.tiktok.com/@kurashiru.com
▼ LINE
https://line.me/R/ti/p/%40oa-kurashir...
▼ Facebook
https://www.facebook.com/kurashiru.net/
#sweets
#recipe
#Howtomake

function return 在 Sweets Life by kurashiru Youtube 的最佳解答
※With subtitles※
The video has subtitles for the quantity and how to make it.
Please turn on subtitles and watch.
Kurashiru app
▼ iOS app
https://app.adjust.com/npk6jm1
▼ Android application
https://app.adjust.com/vz3y2u7
Check the app for detailed instructions!
The app is full of other sweet recipes!
-------------------------------------------------- -------------------------------------------------- --------------------
This is an introduction to Canure that can be easily done at home. The vanilla scent is irresistible. You can enjoy a crispy surface and a moist texture inside. It's a recipe that doesn't damage the dough, so it's easy to make. Please try it!
Cooking time: 100 minutes
Estimated cost: around 400 yen
【material】
6 pieces (120 ml cane type)
250 ml of milk
130g sugar
Strong powder 35g
Light flour 35g
Salted butter 15g
1 egg yolk (medium size)
1/2 beaten egg (medium size)
1/2 vanilla bean
30 ml of rum
5 drops of vanilla oil
-For mold-
Unsalted butter 10g
Granulated sugar 10g
【procedure】
1. Cover the mold with unsalted butter, sprinkle with granulated sugar, and cool in the refrigerator.
2. Make a vertical cut in the vanilla beans, remove the seeds from the pods and separate.
3. Put milk, salted butter and 2 in a pan, heat on medium heat, just before boiling, remove the pod from 2 and remove from heat.
4. Sift strong flour, soft flour and sugar into a bowl and mix with a whisk.
Add half of 5.3 and mix well. Add beaten egg and yolk and mix, then add the remaining 3 and mix.
6. Add rum and vanilla oil, mix, wrap and rest in the refrigerator for about 24 hours.
7. Strain with a strainer, transfer to another bowl and return to 28-30 ° C. During this time the oven is preheated to 220 ° C.
Pour until the 9th minute of 8.1.
9. Bake in an oven at 220 ℃ for 15 minutes, lower to 180 ℃ for about 60 minutes, and bake until the color is brown and the heat goes through.
11. Remove rough heat and remove from the mold to complete.
[Cooking Tips]
This recipe uses honey. Please note that children under 1 year old (infants) should not eat.
This recipe uses rum. Alcohol may be contained depending on the heating condition, so please be careful if you are vulnerable to children or alcohol, pregnant or lactating. Also, refrain from drinking alcohol while driving, playing sports or taking a bath.
Honey can be replaced with sugar. Each type has different sweetness, so please adjust it to your liking.
Be sure to preheat the oven before baking.
If the oven has no preheating function, set the temperature and heat for 10 minutes before baking.
Depending on the type of oven used and the age of use, errors may occur in the thermal power. Be sure to adjust the baking time as a guide.
If it gets too brown, cover it with aluminum foil.
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■
A channel dedicated to sweets. Recipes are posted on kurashiru!
Here are some simple and delicious sweets recipes!
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■
Kurashiru app
▼ iOS app
https://app.adjust.com/npk6jm1
▼ Android application
https://app.adjust.com/vz3y2u7
Kurashiru SNS
▼ Twitter
https://twitter.com/kurashiru0119
▼ Instagram
https: //www.instagram.com/kurashiru/? ...
▼ TikTok
https://www.tiktok.com/@kurashiru.com
▼ LINE
https://line.me/R/ti/p/%40oa-kurashir...
▼ Facebook
https://www.facebook.com/kurashiru.net/
#Sweets #Recipes #Kurashiru

function return 在 Returning Multiple Values from a Function - JavaScript Tutorial 的必吃
In this tutorial, you will learn how to develop JavaScript functions that return multiple values. ... <看更多>