Maps and for of loop in javascript
Vložit
- čas přidán 6. 09. 2024
- Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
All the learning resources such as code files, documentations, articles and community discussions are available on our website:
chaicode.com/
You can find our discord link, github link etc on the above website.
Twitter/X link: x.com/hiteshdo...
Discord link: hitesh.ai/discord
Learn React with 10 projects: • Let's learn react from...
Learn Docker: • A practical guide on D...
Learn Kubernetes: • Complete Kubernetes Co...
How does a browser works: • How does a browser wor...
How nodejs works: • How node JS works | En...
Learn Redux-toolkit: • Learn Redux Toolkit in...
Learn NextJS: • Nextjs Full stack course
Learn Typescript: • Why to learn Typescript
Learn Javascript: • Welcome to new JavaScr...
Learn React Native: • React Native Mastery: ...
Learn Zustand: • React state management...
Learn Golang: • How to get started wit...
Here's the assignment to print the newMap :
for (const [key, value] of newMap.entries()) {
console.log(`${key} = ${value}`);
}
Loving this course Sir :D
for (const video of javascript.videos()) {
console.log(` ${video}`);
}
i want to learn everything from you in my whole life... you're the best teacher
Dil ki bat bool Di bro...😃
You are my one of the best teacher I have ever found. I will complete all course from your website sequentially. Many many thanks for all of your work for us. Wish you a good and healthy life.
Comments like this keeps me going, even at late night
Sir, Your content is one of the simplest and sorted content in YT. It's really great to learn from you.
Sir, I was that person who really got afraid when I saw coding seriously I didn't like it . But somehow I want to learn it. The way you teach is really amazing and now I am loving to code. This can happens only because of you. Thanks for such a wonderful content and the best part is the way you teach is amazing.
For anyone wondering: you can also simply do for(const [key,val] of users) console.log(...)
i am learning this course from you sir even it is after two years the information you provide is awesome sir
Sir, The way you explain is topnotch.
Thanks for you awesome quality videos.
Boom!
finally i understood the concept of map , great video hitesh bro.
Your courses are like food you feel weak when you don't have it
So keep doing sir we're really enjoying it and god bless you in your entire life ❤️
Thanks in a million. "great teachers are great to find."
I am just loving this series, now i can write my Firebase Cloud Functions using javascript. Thanks for the series Hitesh Sir
Thank you so much for your videos. They help me a lot.
You made me understand it much better than I did when I first learned it thank you
hey everyone, thanks for video - to the author! I really have no explanation: ??!! what's wrong with these results -Here it happened when for-of loop was being explained. So here it is : when the console.log is used ( in browser console !) and is written this way - in single line: console.log(key + ' = ' + value ); >> RESULT is displayed with 'Object object' > RESULT is same in first line, but OBJECTS in THE 2nd LINE - CAN BE OPENED now. .. What's changed??? Must be some simple thing, but it looks pretty mystic for me, I meet this ALWAYS in BROWSER's console...And this is NOT just a useless thing !!! - I have always to write all console.logs in TWO lines - everywhere when checking code ! It is so many additional loines! Any ideas ?...
We are learning JavaScript in very deep and I am enjoying it very much😃
The manner in which map was taught is awesome Sir although its complex topic
//assignment one litterate valeues
for (const [key,value] of users.entries()) {
console.log(key + ' =' , value)
}
var arrOfarr = [['one',1],['two', 2],['three', 3]]
var newMap = new Map(arrOfarr)
console.log(newMap)
//this is simple assignment itret vallues from array of array
for (const [key,value] of arrOfarr.entries()) {
console.log(key + ' =' , value)
}
I love this series...
At last, what you told , converting arrofarr to map will only work for if we give only two elements in each array(out of which first one is key and second one is value). Of-course map is considering only second element in array as value. It's not bothering about third and so on. Am I right ??
oooohhhooo .... One more lesson to learn Befor sleep.......... thanks for updating this course sir ......... love your video in Js ..........
let Mymap = new Map(arryofarry)
for([key , value] of myMap.entries() {
console.log( `${value} = ${key}` )
}
You are doing really good. I'm watching and enjoying a lot. Thanks for your effort.
Nights are more productive than days... I'm I right, sir??😁😁❤️
fact!!
Fall 🍁🍂 in love with with your all course videos
But have fear about Linux installation... 🙁 thank u again sir and looking for all upcoming free video courses series u tell everyone why we should and to what learn..
For those who are wondering about previous vidoes which are not in playlist
They are in learncodeonline JAVASCRIPT course . I also find after some times
It is sad that the NOSQL setups are going to become obsolete. They are a bad idea gone bad.
Go to SQLite instead.
I cannot remember the article that cleared this up, but it left no doubt.
Thanks a lot sir
Best videos ever in youtube
The series is getting me involved i have switched to js from java.I want to learn react native for that i need to learn about class i think this is the best tutorials.If you have can you please create a tutorial for react native.
You make it super easy😊
Yes sir, its really help me thanks sir .
Another great video of your Awesome JS Tutorial series. I am in love with this series. Great work and keep it up 👌🏻🤘🏻.
Sir I am student from Android development of learn code online. Sir can u add some videos in ur course showing the clone of any other famous or great apps
Enjoying the series .... Thanks a lot sir
Wow the way you teach is awesome👍
Fabulous sound clarity 😍
Amazing stuff i really enjoy this. Love from Pakistan
It's too good, but sir if you tell us how to use maps in real projects, then it will become really helpful.
And your video also lovely and your language mindbloin
thank you so much, sir
error handling video is missing , could you add that please?
good teacher
Good and thanks a lot
Sir, the thing which I found that can it be possible to cut down the price of the courses because as a student it is really difficult to manage that cost. Please if possible to do may be it can be better for everyone.
thankyou so much bhaiya
Hi sir... Can you make one real time project based on Java script & node
is the assignment 'convert the above line in literals ' means that we explain how the code work with our words?
im also learning some good english.thanx a lot
Yes we love this series sir
Superb Job Bro...fabulous!
Yeah! love this series alot .
Thanks for such good video
We love this series
thank you Muta.
thank you so muchhh sir
can anyone explain how to iterate an dictionary object which contains multiple dictionary in it.
Please start up a series based on python Django flask and data science. You are doing an amazing job teaching to code . Thank you :)
already did django at learncodeonline.in :)
Hitesh Choudhary thank you I will check it up :)
I am getting this error while assigning key value to empty map "Cannot read property 'set' of undefined"
Really loving it! Keep it going!
Sir plzz tell how to serve army as an ethical hacker.. And what course is required
why are we using const in for of loop?
Even if i use newMap instead of newMap.entries(), i am getting the same result, So what is the need for entries()?? Please explain me
var arrofArr = [['One', 1], ['Two', 2], ['Three', 3]]
var newMap = new Map(arrofArr)
console.log(newMap)
for (const [key, value] of newMap.entries()) {
console.log(`${key} = ${value}`)
}
Sir the video of exception handling is missing. . .
If possible, upload that too please
For the upcoming learners you can search for "exceptional handling in javaScript by Hitesh Chaudhary" seperately on youtube.
Superuub..
Can anybody tell me how can someone populate a map in runtime.
I have a usecase such that i am taking data from input texts from a form and i want to insert them in a map datastructure.
sir please start a new playlist about php coding.
I like that
Am from Kenya thanks a lot am I right on the assignment on this specific assignment ? my solution is newMap.forEach((value, key) => console.log(key + ' = ' + value.name));
Shit! i got confused at forEach loop. Now, i have to go and watch previous videos ;-;
Dude you're awesome!
Good job bro !!!
Sir amazing ...
sir where is video of iterators and generators? Is that in this series
please do provide the way to use those shortcut tools like multi-cursor and other cool stuff :)
Hey Anshu Joshi, for multi-cursor hold the ctrl key and click on the area where you want it. That's it
Cool. can you make more advanced lessons ?
Enjoy
Please make tutorials on angular 4 or higher 🙌
var arrofArr = [['one', '1'],['two', '2'],['three', '3']];
var newMap = new Map(arrofArr);
for ([key, value] of newMap.entries()) {
console.log(`${key} = ${value}`);
}
var arrofArr = [['one', 1], ['two', 2], ['three', 3]]
var newMap = new Map(arrofArr)
console.log(newMap.keys())
This prints all the keys like 'one' 'two' 'three' but when i try console.log(`${newMap.keys()}`) it rather prints [object map itreator]. Can you please tell me why?
These are some log statements that does not print valuable information:
console.log(newMap.keys() + ' = ' + newMap.values());
console.log(`${newMap.keys()} = ${newMap.values()}`);
Explanation Required for these statements too.
you have to use for of loop for printing each iterator, just try this it will work ---
var arrofArr = [['one', 1], ['two', 2], ['three', 3]]
var newMap = new Map(arrofArr)
for(const [key, value] of newMap.entries()){
console.log(key + ' = ' + value);
console.log(`${value}`)
console.log(`${key} = ${value}`);
}
Thank you :)
you have not uploaded try catch video in the series.....please upload it
Hey where is your try catch session ???
in your ../01advance folder there is one more file for trycatch.js
where is that session
complete list of video is available on Learncodeonline website, you will find all videos there
can someone please tell me what does he mean by string literals!!!! like i cannot understand his assignment properly
Me too :/
maybe we explain how the code work with our words
string literal is the string value which is stored
“Literal” simply means that it's the value itself, rather than a variable. ... For example: const dog = 'Santa's Little Helper'; Santa's Little Helper is a string literal, whereas dog isn't.
I like for each loop dan for of..
Aww my correction newMap.forEach((value, key) => console.log(key + '=' + value));
use console.log(`${key}=${value.name}`); instead
enjoyed
Sir the previous video is not in the playlist.
😕😕😕
yeah the try catch one
where is try and catch tut?
👍
And one how to make app with java
Can anyone plz explain or share assignment
what is string literals?
`` are the string literals
learning a loot
♥
How to make games like a GTA,Shadow gun etc
start learning unity
Why no Saturday live bro?
I am working on this series and little busy with personal stuff :)
Sir make videos. On dark web
please add videos at a faster pace
These videos takes time to prepare content, putting up best possible example, recording, editing and publishing.
Also my goal is that students should be able to repeat what I am doing.
sir hindi mai ku6 kijiye na