Debugging JavaScript Cool trics and tips

  Рет қаралды 60,354

techsith

techsith

Күн бұрын

Пікірлер: 131
@Morfij
@Morfij 6 жыл бұрын
console.trace(); shows call stack. useful with nested functions
@nicolashervy7544
@nicolashervy7544 6 жыл бұрын
Console.assert can be handy if you only want to print to log when something gone wrong. Thanks for many good videos👌
@kushp6486
@kushp6486 6 жыл бұрын
Waiting for the next video. Had no idea console.time exists before
@nekoill
@nekoill 4 жыл бұрын
Found this one in my suggestions, subscribed immediately. Great tips!
@SKU009
@SKU009 6 жыл бұрын
Today I learned about console.time and console.table. Thanks Techsith
@Techsithtube
@Techsithtube 6 жыл бұрын
I am glad you learnt something new. Keep learning!
@tomgabauer9878
@tomgabauer9878 6 жыл бұрын
Thanks for another great vid! As a new learner, these really help me. Cheers.
@jared4941
@jared4941 6 жыл бұрын
Just wanted to say thank for all your videos. I'm currently in school for coding and your videos have been such a great help.
@sudhakarlahane7229
@sudhakarlahane7229 2 жыл бұрын
Thank you again! Every time I get & learn something new from your videos! Lovejoy video 👌
@brak51
@brak51 5 жыл бұрын
I am learning Javascript for work, since I inherited a job that is all about JS security, troubleshooting, so this video was very helpful. Please make more like it. Thanks
@Techsithtube
@Techsithtube 5 жыл бұрын
Yes, debugging is an art. especially inside the inspector. I will create some advance topics on debugging for sure. Thanks for watching!
@abhinandsagar3736
@abhinandsagar3736 5 жыл бұрын
This video has a Separate Fan Base ;) I'll be expecting to see the sequel of this.
@PrabhakarBangalore
@PrabhakarBangalore 6 жыл бұрын
You can little cover the watch section where you can add variables to see it's value change separately inside source tab.
@Techsithtube
@Techsithtube 6 жыл бұрын
Good point . thanks for sharing.
@phplaw
@phplaw 6 жыл бұрын
Just clicked on the Ad to support you, very good video
@Techsithtube
@Techsithtube 6 жыл бұрын
Thanks sunny . I appreciate your support!
@spd1270
@spd1270 3 жыл бұрын
Thanks @techsith for helping us to get better in our job!
@Techsithtube
@Techsithtube 3 жыл бұрын
Glad to have helped. Keep on learning!
@jonydude
@jonydude 6 жыл бұрын
This was my first exposure to your work. I remember thinking, "These tips are either going to be so obvious, I already know them, or so advanced they're not applicable to any of my current projects." I want you to know, this prediction was wrong about every single tip you presented. None of them I knew, and none of them are useless to me.
@Techsithtube
@Techsithtube 6 жыл бұрын
What was the biggest surprise? Just curious.
@jonydude
@jonydude 6 жыл бұрын
techsith I don’t think things I don’t know can be ranked by size, as I didn’t know any of them, but the most influential is to stop debugging with alerts. I don’t just debug with alerts, I build with alerts. I test every if statement with an alert before filling it.
@viraldimention
@viraldimention 6 жыл бұрын
Awesome tutorial, Loved it. A little request here to make part 2 with, I mean more cool stuff, like conditional breakpoints, call satck, watch, scope, performance tab, memory tab etc. Thanks
@Techsithtube
@Techsithtube 6 жыл бұрын
That is the plan . Will try to release it next week .
@phanCAbe
@phanCAbe 5 жыл бұрын
Wow. Outstanding content, that may have been the most professionally useful thing I've seen all year...
@buncha1499
@buncha1499 6 жыл бұрын
Thanks again TechSith! Great stuff!
@piotrkniaz4695
@piotrkniaz4695 6 жыл бұрын
great video! Debugger is something that can replace every .log i can't imagine my work without debugger notably when we want to refactor very big application it can save a lot of our time. So I am waiting for debbuger video and maybe i will know a litle bit more :)
@MegaLearningStuff
@MegaLearningStuff 6 жыл бұрын
you mean debugger; or something else ?
@piotrkniaz4695
@piotrkniaz4695 6 жыл бұрын
regarding to your question , i mean debugger;
@Pareshbpatel
@Pareshbpatel 3 жыл бұрын
Great Intro to Debugging in JS. Thanks. {2021-08-04}
@PrashadDey
@PrashadDey 6 жыл бұрын
Hello! Could you make a playlist for "You Don't Know JS" - 6 books series by Kyle Simpson, describing some of the important concepts of js? It will be very beneficial to you and your viewers as well?
@3jyothi
@3jyothi 4 жыл бұрын
Cool tricks ☺ waiting for its sequel.
@Techsithtube
@Techsithtube 4 жыл бұрын
Coming soon!
@masibhai339
@masibhai339 5 жыл бұрын
Waiting for next videos doing great job.really appreciate that
@balanepalaiyathane9714
@balanepalaiyathane9714 4 жыл бұрын
Really Good tutorial you are taking of care all people especially who wants to start career... This is called real help for the community...
@rajashekhar433
@rajashekhar433 5 жыл бұрын
javascript profiler? Performance?
@abhishek_k7
@abhishek_k7 5 жыл бұрын
Loved this video. If possible, can you make videos on each Chrome Dev Tools tabs? I just know the basics of Networking, Audits and Sources tabs. Would like to learn more about all the available tools in depth.
@shoaibah
@shoaibah 6 жыл бұрын
Array.from() will also create a copy. Curious to know the difference between Array.from and JSON.parse(JSON.stringify)
@DontStopMoveOn
@DontStopMoveOn 5 жыл бұрын
Also [...array]
@MrPDTaylor
@MrPDTaylor 6 жыл бұрын
Is there a similar function that creates a table from an object that is useful in the actual body of code?
@roshnikutty4252
@roshnikutty4252 6 жыл бұрын
Great video! Looking forward to its sequel!
@alena422
@alena422 5 жыл бұрын
love your videos, thank you very much! :)
@ayk2412
@ayk2412 6 жыл бұрын
Excellent stuff as always!
@kathirvelponnusamy
@kathirvelponnusamy 6 жыл бұрын
Wow.. awesome ☺️ .. one tiny suggestion.. just modify the 'trics' to 'tricks' in title if possible.. I was trying to search 'tricks and tips' but I didn't get this video listed in search results...
@utpalkant6354
@utpalkant6354 4 жыл бұрын
You don't know but you helped us a lot. Gratitudes for you 🙏
@Techsithtube
@Techsithtube 4 жыл бұрын
Utpal, keep on learning! Thanks for the comment.
@ivanskubko9177
@ivanskubko9177 5 жыл бұрын
Instead of console.log(JSON.parse(JSON.stringify(x))) you could do much more readable syntax console.log([...x]) for arrays
@bobmarleyy1976
@bobmarleyy1976 4 жыл бұрын
Yes but last one is a shallow copy. Nested array will keep their reference too in that case, so with parse and stringify you're sure to clone deep objects
@hamsteroncoffee
@hamsteroncoffee 6 жыл бұрын
Great tutorial! I did not know the "pretty print" at the end of this. Pretty cool stuff. Thank you for sharing. Also, if you haven`t done this already: could you please make a video about debugging Node/ API calls? This has been killing me recently :( Many thanks in advance!
@jonnyzheng419
@jonnyzheng419 3 жыл бұрын
I would suggest this code for log debug: let a = 1; let b = 2 console.log({a, b}); // This code would show the variable name and there value.
@evan5854
@evan5854 6 жыл бұрын
Make these vids longer bro, good stuff
@bhushi5764
@bhushi5764 6 жыл бұрын
Very useful information you shared. Thanks!!!
@WasimKhan-0801
@WasimKhan-0801 6 жыл бұрын
Nice trick and Trip sir it will really help in development. Sir is there any replacement of moment.js who works really good in any time zone because moment giving wrong results of display date in some time zone eg. Check with Sydney or apia time zone
@dearvivekkumar
@dearvivekkumar 6 жыл бұрын
I havev seen peoples debugging badly writtenjQuery code and they have hard time finding the handler function for any element. Using the event inside of right section of the source tab is very helpful as chrome debuggers stops automatically at the handler function and we can blackscript library code. I will try to post the screenshot when I will be on my PC Second is the DOM breakpoint to know which code in the source is modifying the attributes or subtree Conditional breakpoint for debugging code inside of loop or frequently called function Watching variable is another one
@MegaLearningStuff
@MegaLearningStuff 6 жыл бұрын
please do :)
@adityaghosalkar431
@adityaghosalkar431 6 жыл бұрын
the most irritating problem while debugging javascript in chrome is you constantly land in some javascript library which you are using while debugging your own code do you have any tricks to solve that
@MegaLearningStuff
@MegaLearningStuff 6 жыл бұрын
yes, blackbox it, just right click it is there, next time it will skip over :)
@Techsithtube
@Techsithtube 6 жыл бұрын
put a debugger in your code and it will always stop into your code and then if its a loop . just click continues and it will stop at the next debugger . So you don't have to do next next next each time and go through some other lib.
@npaul1440
@npaul1440 5 жыл бұрын
Your tutorials are really awesome
@janaks7016
@janaks7016 6 жыл бұрын
Very useful videos, thank you bro
@malvikatiwari3857
@malvikatiwari3857 4 жыл бұрын
Hello, I have a question regarding JavaScript, Can you help with that? Actually I need to know the inbuilt libraries of javascript to fetch data from a third party API.
@malvikatiwari3857
@malvikatiwari3857 4 жыл бұрын
@techsith can you name all the inbuilt libraries for this purpose?
@rahulvanave
@rahulvanave 6 жыл бұрын
Call stack in chrome Explain this to others It's really useful in execution
@Techsithtube
@Techsithtube 6 жыл бұрын
Yes , that would be a good topic to cover. Thanks for the suggestion.
@rohitkudalkar92
@rohitkudalkar92 5 жыл бұрын
Above trick was really helpful. Sir can you please make a separate video only on debugging. How to improve debugging react Application in VScode or in chrome. thanks
@Techsithtube
@Techsithtube 5 жыл бұрын
Rohit, I do have a plan for such series. I will plan for it. Thanks for the suggestion.
@rohitkudalkar92
@rohitkudalkar92 5 жыл бұрын
@@Techsithtube, curious to learn new debugging skills from you, sir. Thanks
@dubeykivines9202
@dubeykivines9202 4 жыл бұрын
Nice Information shared thanks
@alokranjan476
@alokranjan476 6 жыл бұрын
Nice one😊👍 Please make video for other tabs also.
@Carl-yu6uw
@Carl-yu6uw 5 жыл бұрын
Great stuff! Thank you.
@dillikathirvel8628
@dillikathirvel8628 6 жыл бұрын
Super techsith. For console.table
@VijayaKumar-qy6oj
@VijayaKumar-qy6oj 6 жыл бұрын
Seems your tips may useful for beginner's (below 1 year experience). People updating more we think.
@lahotiashish
@lahotiashish 4 жыл бұрын
Here is the written version of this video:- codingnconcepts.com/javascript/debugging-tricks-javascript/
@vikashire5292
@vikashire5292 5 жыл бұрын
Yes. Thanks for these tricks. Please make a video on developer tools in chrome.
@Techsithtube
@Techsithtube 5 жыл бұрын
Yes that would be an interesting video. Thanks for the suggestion.
@vikashire5292
@vikashire5292 5 жыл бұрын
@@Techsithtube we will wait for that.
@brunofunnie
@brunofunnie 6 жыл бұрын
Nice stuff, but it's really basic, it was already on my mindset of debug tools. It would be great if you dive into Memory Leaking detection, that's a very interesting subject for a video. How to identify, how to identify in a big project, using comparison snapshots checking for delta values... nice video thou
@phemant24
@phemant24 6 жыл бұрын
Very informative, thank you
@karthikpa
@karthikpa 6 жыл бұрын
Very useful tricks.
@Techsithtube
@Techsithtube 6 жыл бұрын
Thanks for watching Karthikeyan.
@hiteshchoudhary3412
@hiteshchoudhary3412 6 жыл бұрын
Please do more videos like this
@welterdavin5486
@welterdavin5486 6 жыл бұрын
spot on
@johnywalkie
@johnywalkie 6 жыл бұрын
console.log("%c I am red", "color: red");
@Techsithtube
@Techsithtube 6 жыл бұрын
That is also a cool trick Thanks for sharing!
@brianserious
@brianserious 5 жыл бұрын
@@Techsithtube sounds like you might get a http 418 from that :)
@rajesharya3645
@rajesharya3645 5 жыл бұрын
Awesome..............
@hamidrezakazemi7746
@hamidrezakazemi7746 6 жыл бұрын
console.time & table is awesome. for nodeJS debugging --> chrome://inspect section and run node file with --inspect
@sudarsanapilli8371
@sudarsanapilli8371 5 жыл бұрын
Hi techsit, after creating an array in console. let a= [1,2,3]; console.log(a); --> my console showing "undefined " output:-- >>undefined --> how to see the output . any suggestions are highly appriciated
@Techsithtube
@Techsithtube 5 жыл бұрын
in the console you simply type a , dont use console.log(a)
@davvar100
@davvar100 4 жыл бұрын
instead of let a = 'a' , b = 'b' console.log( 'a :', a ,'b :',b ) you can do console.log( { a, b } ) and get { a: {}, b:{} }
@damilolaolowookere7658
@damilolaolowookere7658 6 жыл бұрын
Man you're awesome!!
@Techsithtube
@Techsithtube 6 жыл бұрын
Thanks for an awesome comment. :) Keep learning!
@doaahashim7320
@doaahashim7320 6 жыл бұрын
Like like like it helped me a lot thank you
@himanshushekhar3694
@himanshushekhar3694 4 жыл бұрын
really cool video
@PrashadDey
@PrashadDey 6 жыл бұрын
Worthful video.
@j.almadhaji
@j.almadhaji 6 жыл бұрын
new useful tricks for me thank you sir
@welterdavin5486
@welterdavin5486 6 жыл бұрын
good for you
@sunilkumar-zf4dx
@sunilkumar-zf4dx 6 жыл бұрын
Wow very useful stuff..
@kirankumar-zf9yd
@kirankumar-zf9yd 6 жыл бұрын
Good 1, can you please come up with event looping in your next video...??
@Techsithtube
@Techsithtube 6 жыл бұрын
You mean Concurrency model and Event Loop?
@sushantkunkekar2155
@sushantkunkekar2155 6 жыл бұрын
@@Techsithtube how to debug loop and funtions exclusively
@kirankumar-zf9yd
@kirankumar-zf9yd 6 жыл бұрын
Yeah, It would be great to hear from you because most of the people will learn how js engine reads sync and async events...
@Techsithtube
@Techsithtube 6 жыл бұрын
Got it. I will add that to the sequal to this video . Thanks for the suggestion
@mtmecax
@mtmecax 6 жыл бұрын
helpful video
@rounakjain5774
@rounakjain5774 6 жыл бұрын
Instead of console.log('aaaa', 'x: ', x, 'y: ',y), use console.log({x, y})
@AshwaniSharma-vg5xm
@AshwaniSharma-vg5xm 4 жыл бұрын
Nice
@RanjeetKumar-gg7ie
@RanjeetKumar-gg7ie 4 жыл бұрын
awesome :)
@sandeepsandy214
@sandeepsandy214 6 жыл бұрын
Thank you guruji
@Techsithtube
@Techsithtube 6 жыл бұрын
Thank you Sandeep for watching!
@sandeepsandy214
@sandeepsandy214 6 жыл бұрын
I am a huge fan for u
@Oswee
@Oswee 5 жыл бұрын
Tnx for console.time() ! :)
@Techsithtube
@Techsithtube 5 жыл бұрын
Yes Console.time is pretty cool
@DamianNAudio
@DamianNAudio 5 жыл бұрын
I wouldn't ask for help translating your videos, programming is all about English. And math.
@andriiauziak1178
@andriiauziak1178 5 жыл бұрын
nice comment))
@Techsithtube
@Techsithtube 5 жыл бұрын
Thanks for the nice comment brother.
@andriiauziak1178
@andriiauziak1178 5 жыл бұрын
​@@Techsithtube Thanks for what you are doing, Sir. By the way, is it possible to know, how much people from different countries watching your youtube channel
@believeme6310
@believeme6310 6 жыл бұрын
Hii sir
@believeme6310
@believeme6310 6 жыл бұрын
And also I am first viewer
@weichengye3736
@weichengye3736 5 жыл бұрын
console.log({a});
@believeme6310
@believeme6310 6 жыл бұрын
This is my first comment
@kuba5764
@kuba5764 2 жыл бұрын
asd
@juleswinnfield9931
@juleswinnfield9931 6 жыл бұрын
console.debug();
@farshidbahmanian
@farshidbahmanian 5 жыл бұрын
Not really useful stuff, but thanks
@MrityunjayKumar-v3e
@MrityunjayKumar-v3e 11 ай бұрын
dur boor
@handsome_man69
@handsome_man69 6 жыл бұрын
when is chrome dev tools going to improve with debugging closures? I always get no reference error, or undefined error when looking at variables. Granted this also happens when I debug in webstorm.
@Techsithtube
@Techsithtube 6 жыл бұрын
I think the chrome dev tool is pretty advanced. undefined is because it's probably out of scope.
top 10 JavaScript tricks
17:18
techsith
Рет қаралды 19 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
how to actually improve as a photographer in 2025
15:56
Matt Day
Рет қаралды 4 М.
Tricky JavaScript interview questions and answers
21:01
techsith
Рет қаралды 133 М.
How To Debug JavaScript In Chrome
12:32
Code With Bubb
Рет қаралды 27 М.
Tips and Tricks for Debugging JavaScript
13:03
James Q Quick
Рет қаралды 416 М.
Tips for using Chrome DevTools
15:33
Ben Awad
Рет қаралды 5 М.
Top Tricky JavaScript Interview Questions and Answers
15:42
techsith
Рет қаралды 83 М.
Are you debugging JavaScript in VSCode? | YOU SHOULD!
7:06
Alex Ziskind
Рет қаралды 171 М.
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 844 М.