top 10 JavaScript tricks

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 85

  • @IvanHaha
    @IvanHaha 3 ปีที่แล้ว +4

    Tricks like `a = (b+= a -=b) - a;` are pretty neat but people really need to ask themselves:
    1. What do I value more, short code or readable code?
    2. Am I the only person who's going to work with this code and if not, are they going to understand my code, am I going to understand this code in a month?

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +3

      Ivan, As I said in the video, this particular trick is not to use in the code , its for interview question.

    • @antrasinha8045
      @antrasinha8045 2 ปีที่แล้ว

      a= a + b;
      b= a - b;
      a= a - b;
      Same code but neat/understandable.

  • @BeyondWithAlireza
    @BeyondWithAlireza 3 ปีที่แล้ว +8

    Tech sith is back finally :)

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Ali, glad to be back! Thanks for watching!

  • @sumodsivadas6959
    @sumodsivadas6959 3 ปีที่แล้ว +5

    Awesome videos, i always suggest your videos to my friends, thanks for making these.... ❤️

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +1

      Sumod, so nice of you to share my videos with your friends. :) THanks for watching!

  • @amazecreations1853
    @amazecreations1853 2 ปีที่แล้ว +2

    Great content, explained in simple way, really underrated channel.

  • @rupambasak6435
    @rupambasak6435 3 ปีที่แล้ว +1

    Your teaching is best for me. Thanks. keep growing and let us updated

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +1

      Rupam, so nice of you.

  • @karlstenator
    @karlstenator 2 ปีที่แล้ว

    Very cool tips, thanks for sharing! ☕

  • @ibtesamuddin2061
    @ibtesamuddin2061 2 ปีที่แล้ว

    thanks a lot for such great videos 🤩 already subscribed ⭐

  • @vakhtangnodadze4947
    @vakhtangnodadze4947 3 ปีที่แล้ว +1

    Your content is simple but GREAT. You are explaining interesting and important topics very understandable. I just wanted you to know that. You really deserve more views and subs.
    Thank you for taking the time

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Vakhtang, I appreciate the awesome comment. Thanks for watching!

  • @azamatgiyasov5033
    @azamatgiyasov5033 ปีที่แล้ว

    Great content

  • @sireeshakuna5686
    @sireeshakuna5686 3 ปีที่แล้ว +2

    Great video again, thank you 👍

  • @icyheat1463
    @icyheat1463 2 ปีที่แล้ว

    Great video, just one thing: Document.execCommand() is now deprecated, and we should use the Clipboard API instead.

  • @philsitumorang
    @philsitumorang 2 ปีที่แล้ว

    This is really usefull! Thank you so much!

  • @ConnorAZ
    @ConnorAZ 3 ปีที่แล้ว

    Techsith is always awesome and its always a pleasure talking to you over on twitter..Talking about different conspiracy and thoughts about JavaScript and our developer ecosystem

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      I enjoy it too. Thanks for watching!

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 3 ปีที่แล้ว

    Thanks for this I recently found your channel (After badly performed in a Js interview 😅 but still I cleared it) , Interviewer asked me a question related to Object.freeze() and Today just found the same question in one of your videos, worth it content and your teaching is also so cool 🔥😁.

  • @Vijay-Yarramsetty
    @Vijay-Yarramsetty 3 ปีที่แล้ว

    That was great video

  • @lone-warrior-13
    @lone-warrior-13 3 ปีที่แล้ว +1

    really useful tricks, thanks

  • @junfengou6856
    @junfengou6856 3 ปีที่แล้ว

    So glad I stumbled across this channel, thanks for all these useful tips

  • @dipeshranavlogs
    @dipeshranavlogs 3 ปีที่แล้ว +1

    Great 👌

  • @varaprasad4163
    @varaprasad4163 3 ปีที่แล้ว +1

    Guru is back.

  • @CodingNuggets
    @CodingNuggets 3 ปีที่แล้ว +2

    Great video. Always love these tips and tricks videos. It's interesting getting someone else's perspective and how they deal with code. Thanks my friend. See you soon!

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +1

      Glad you enjoyed it! Thanks for watching!

  • @aliezadkhaha9439
    @aliezadkhaha9439 3 ปีที่แล้ว

    Very nice

  • @rishireddy7854
    @rishireddy7854 3 ปีที่แล้ว

    Tech sith can we expect JavaScript coding questions tutorials

  • @VipinRawat_Offcial
    @VipinRawat_Offcial 3 ปีที่แล้ว

    Most of the tricks are new for me.. amazing 👌👌

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Vipin, Glad to hear that. Thanks for watching!

  • @rahulk.creative
    @rahulk.creative 3 ปีที่แล้ว

    These tricks are really helpful....thanks for the awesome video😊

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +1

      Rahul, Glad you like them! Thanks for watching!

  • @Siva-lx9dw
    @Siva-lx9dw 3 ปีที่แล้ว

    Hii bro... I have some doubts in reactjs bro..Can you give your id or any community is there.. Pls tell me bro

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      You can email me . You can join my facebook community for react. Its on my channel page.

    • @Siva-lx9dw
      @Siva-lx9dw 3 ปีที่แล้ว

      @@Techsithtube I already given a join request bro.. Please accept it bro

  • @GS-tx8ib
    @GS-tx8ib 3 ปีที่แล้ว

    I wish you brought back the javascript interviews series, in those videos I always learn something new

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +1

      Yes, I am planning to make some more such videos. I do have another channel which focuses on interviews , its interviewnest do check it out.

  • @vasanthakumarnagamuthu3106
    @vasanthakumarnagamuthu3106 3 ปีที่แล้ว

    Excellent Video. Thanks for providing such a wonderful tricks.
    One small deviation at 14:54 is value.some(Boolean) - checks if there is any non empty values and returns true. But your context mentioned in the other way. Thanks!

    • @skylarkendrick656
      @skylarkendrick656 3 ปีที่แล้ว

      you probably dont care at all but does someone know a trick to get back into an Instagram account??
      I somehow forgot the password. I would love any help you can offer me

    • @stetsondavian5756
      @stetsondavian5756 3 ปีที่แล้ว

      @Skylar Kendrick instablaster :)

    • @skylarkendrick656
      @skylarkendrick656 3 ปีที่แล้ว

      @Stetson Davian i really appreciate your reply. I found the site thru google and im waiting for the hacking stuff atm.
      Seems to take a while so I will reply here later with my results.

    • @skylarkendrick656
      @skylarkendrick656 3 ปีที่แล้ว

      @Stetson Davian It did the trick and I now got access to my account again. I'm so happy:D
      Thanks so much, you saved my ass !

    • @stetsondavian5756
      @stetsondavian5756 3 ปีที่แล้ว

      @Skylar Kendrick You are welcome =)

  • @AmarjeetKumar-xr2gf
    @AmarjeetKumar-xr2gf 3 ปีที่แล้ว

    Hi need a help can you help in creating two separate react project each has there own routing and redux ...and there is a third react project where you have buttons to navigate two different project ...it would be great if you come up with some example video of same..thank you

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      There are multiple ways to do it. create three separate projects with their own routing and all . when you do "npm start" , load them on different port . then create a third project with button and links to the URL with different ports.

    • @AmarjeetKumar-xr2gf
      @AmarjeetKumar-xr2gf 3 ปีที่แล้ว

      @@Techsithtube thanks for the response....but no we should have only one port ...for example... localhost:3000/main page
      Then on click of project2 is should be
      Localhost:3000/project1 and inside project one if we navigate to projectdetail the path should be project/projectdetail

  • @kirankumarahir7933
    @kirankumarahir7933 3 ปีที่แล้ว

    Nice tricks

  • @alinawaz4034
    @alinawaz4034 3 ปีที่แล้ว

    14:00 there is a simpler solution to compare 2 arrays, and you can also compare 2 objects or any primitive values
    const compare = (a,b) => JSON.stringify(a) === JSON.stringify(b)

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +1

      yes that is a good solution. Thanks for sharing!

  • @angel_ruggia
    @angel_ruggia 3 ปีที่แล้ว

    Your videos are amazing!

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Glad you like them! Thanks for watching buddy!

  • @kedarkulkarni0074
    @kedarkulkarni0074 3 ปีที่แล้ว

    Hey techsith, can you make a video on how to have patience while watching the long video? I really want to watch the entire video , but I somehow don't have that much patience

    • @mrigankabora4835
      @mrigankabora4835 3 ปีที่แล้ว +1

      start with 10 min, do 15 min next day , then 20 min .. day by day increase ..you will be more patient.

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Good advice!

  • @sakshisharma8660
    @sakshisharma8660 3 ปีที่แล้ว

    Thanks for these tricks😊

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Sakshi, My pleasure!! Glad to hear that. Thanks for watching!

  • @aqumus
    @aqumus 3 ปีที่แล้ว

    As per MDN, execCommand is deprecated or may be deprecated, also browser support is not that great (would be good to have this as a disclaimer)

  • @rajashekhar433
    @rajashekhar433 3 ปีที่แล้ว

    Can you please make a video on CI/CD?

  • @akifcankara2225
    @akifcankara2225 2 ปีที่แล้ว

    We can use user-select: all; css for 5:12

  • @shwethahv1684
    @shwethahv1684 2 ปีที่แล้ว

    const length = 4;
    const numbers = [];
    for (var i = 0; i

  • @namratagiri4240
    @namratagiri4240 3 ปีที่แล้ว

    Nice video, thanks.
    Can you please share video on integrating payment gateway to website( html, css, js website) please 🙏

  • @ahsanfraz9105
    @ahsanfraz9105 3 ปีที่แล้ว

    What where the swap variable valuele value just shift the variable itself , i simplify this u couldnt swap variable value wdout passing by it ref

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      can you explain this in detail.

    • @ahsanfraz9105
      @ahsanfraz9105 3 ปีที่แล้ว

      Absoultly value is imutable then plz define me how it modified but if you talk in static type languages like c# java c+, then pass those variable by reference if you dont them it only remain in function scope but if you want to use these swaping values out side the function then you have to pass these variable by refernce

    • @ahsanfraz9105
      @ahsanfraz9105 3 ปีที่แล้ว

      And secondly I appreciate your service and accept that once I saw your video definitly learn new stuff and always seek to learn new things.

  • @sumeetsood232
    @sumeetsood232 3 ปีที่แล้ว

    was not able to fully understand how 1st trick works-
    a = (b+= a -=b) - a;
    can you explain it how -=b works?

    • @josephwong8105
      @josephwong8105 3 ปีที่แล้ว

      I also need this explanation.

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +2

      let say a = 1, b = 2 , a = a + b ( a=3, b=2) , b = a - b ( a=3, b=1), a = a-b ( a = 2, b=1)

    • @sumeetsood232
      @sumeetsood232 3 ปีที่แล้ว

      I know how swapping of 2 variables without using 3rd variable works but not able to understand the syntax you used i.e where are we calculating a= a+b in
      Expression you used

    • @josephwong8105
      @josephwong8105 3 ปีที่แล้ว

      @@sumeetsood232 for instance?

    • @babakbekhradmanesh871
      @babakbekhradmanesh871 3 ปีที่แล้ว

      @@sumeetsood232 Hi Sumit, for understanding this concept, You have to know about Operator precedence in JavaScript. In this case, the first precedence is Grouping. I mean 'parentheses'. like this (b+= a -=b). Bear in mind that the Associativity is right to left. So as you can see, we need to calculate the right side of parentheses that it is a-=b and it is equivalent to a=a-b. after calculating, we have a=-1 until know (a=1-2). as well as, we need to calculate the left part of parentheses Ok? It is b+=a. so as I told you before it is equivalent to b=b+a. after calculating, we have b=1 like this (2+(-1)). So far our variables are a =-1, b=1. In the next step, we need to calculate the rest of the logic of the code which is a=(b)-a. so as you know we have b Ok? we only need to put it so a =2. like this a=1-(-1). that's it :-). a=2 and b=1. I hope that makes sense to you.

  • @Admiral_Ducky
    @Admiral_Ducky 3 ปีที่แล้ว

    TH-cam ads were not annoying enough, now every youtube channel has its own in video ad. I feel strong contempt for this and I think it's super disrespectful to waste viewer's time by showing long ads at first of every freaking video. I personally avoid those product which are depicted in this sort of ads like a plague.

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว +2

      Ramin, I agree with annoying adds. Let me tell you little bit of history about what is happening so you would understand. TH-cam has reduced income by 50% last year. As a content creator, I spend significant amount of time in producing these videos. 10 min video takes me about 7hrs to produce from concept to final upload. If I want to continue making these video for free, I had to look for some other income source. Hopefully that answer your question.

    • @Admiral_Ducky
      @Admiral_Ducky 3 ปีที่แล้ว

      @@Techsithtube Alright, alright, so maybe it's time to move on! Maybe this way of doing business is dead. Making video and publishing them on youtube is not working! Begginers don't learn like this. They need an interactive environment and community to learn for real. TH-cam was a cash grab for too many years. Most of programming channels are misleading and worthless. Students need to know how they could put their knowledge into practice. These videos lead them to nothing. It's time to do something really different for teaching people if you really care.