10 Javascript Functions Examples You Can Use to Save Time

  Рет қаралды 7,688

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 38
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Javascript utility functions are time savers. Keep them in your "toolbox" or "utility belt" to take to any project you work on. These functions are abstract and can be plugged into any project. I've provided a source code link in the description above which will allow you to create a utility module from the functions featured in this tutorial. Just getting started with Javascript? Check out my full 8 hour course video here: kzbin.info/www/bejne/e5eknWyYrN-JkM0 🚀
@kostiantynkarzhanov9216
@kostiantynkarzhanov9216 Жыл бұрын
Awesome! Dave, thank you so much for sharing your knowledge with us 💛
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@mikanika21
@mikanika21 Жыл бұрын
Great, Thank You for all Your work, Greetings from France
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome! And hello 👋 to France!
@ishan101
@ishan101 3 жыл бұрын
Thank you for sharing this valuable tips indeed.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad it was helpful! 💯
@AH-cf9cv
@AH-cf9cv 3 жыл бұрын
Thanks very much for ur hard work from India.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 🙏
@amerabdelrahman4872
@amerabdelrahman4872 3 жыл бұрын
Thanks for sharing
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome!
@sonnybrown5228
@sonnybrown5228 2 жыл бұрын
this is awesome
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you!
@iketutsistawan4248
@iketutsistawan4248 3 жыл бұрын
what is the function/purpose of capture parameter in the addEventListener utils class?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Good question! It has to do with event bubbling and capturing. You can learn more about it in my Javascript Event Listeners tutorial here: kzbin.info/www/bejne/i4e1daRjrNOZnc0 💯
@marcod.643
@marcod.643 3 жыл бұрын
Did you wear a t-shirt from Kevin Powel? Are you going to have some type of collaboration? It would be awesome! Two of my preferred KZbin content creator, with the best clear, useful, inpiring contents.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks! Yes, I did wear his shirt. Kevin is great and his channel is one of my favorites. I'd love to collab with him sometime! 🚀💯
@abdiag603
@abdiag603 17 күн бұрын
What if in your sanitizeInput() you don’t want to return the value with a div around it, instead of creating the div element is it proper to create a document fragment instead???
@blaircfleming
@blaircfleming 3 күн бұрын
the sanitizeInput() function doesn't return the div, only the sanitized text
@abdiag603
@abdiag603 3 күн бұрын
@@blaircfleming recheck well, it does add a dic around as text content
@blaircfleming
@blaircfleming 3 күн бұрын
@@abdiag603 the div is temporarily created in the function, but the value that is returned is the sanitized content of that div, not the div itself
@rangabharath4253
@rangabharath4253 3 жыл бұрын
Awesome
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks! 🚀
@Knards
@Knards 3 жыл бұрын
Is there some trick to this import? I wrote out the functions in a file called utils, but when I import them way you did, and through reading in MDN Web Docs, all I get in the console is "Require is not defined". The 2 files are in the same directory. My last iteration is import { properCase } from './utils.js';
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
No trick. Did you check the link to the source code in the description? Compared to the video, I added the "export" keyword before const for each function in the gist source code. Other than that, double-check import syntax on MDN here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import You might also make sure you have type="module" in your script element in the HTML file.
@Knards
@Knards 3 жыл бұрын
@@DaveGrayTeachesCode Not sure what I did, but I fixed it. Thanks for introducing me to import/export amd the functions!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@@Knards That's great! I also have a separate tutorial on modules 💯🚀
@Knards
@Knards 3 жыл бұрын
@@DaveGrayTeachesCode Now that I will be checking out!
@andrewclarke6916
@andrewclarke6916 3 жыл бұрын
@@DaveGrayTeachesCode I had a problem with importing the utility functions into my main javascript file at first. Got the error 'Uncaught SyntaxError: Cannot use import statement outside a module'. Fortunately, a quick bit of googling revealed that I needed to add the type="module" attribute to my script tag in the HTML file.
@philip9677
@philip9677 3 жыл бұрын
how do you get both paramOne and paramTwo,
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
The getParameterValue() function is designed to return the value of the parameter name you specify as the first argument passed to the function. You need to call the function for each parameter value you want returned. 😀
@philip9677
@philip9677 3 жыл бұрын
@@DaveGrayTeachesCode thanks dave very helpful
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@@philip9677 You're welcome!
@acethomas5774
@acethomas5774 2 жыл бұрын
Who in these comments can plz help me with JavaScript functions for this online game that i play it has several things that you can do on the game and each thing has a script that can be written for them and book marked
@suelingsusu1339
@suelingsusu1339 2 жыл бұрын
🙏🙏🙏🙏🙏🙏🖖🖖🖖🖖🖖👏👏👏👏👏👏👏
What are Pure Functions? | Javascript Functions Tutorial
15:43
The different types of JavaScript functions explained
14:47
Kevin Powell
Рет қаралды 42 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 4,5 МЛН
Миллионер | 2 - серия
16:04
Million Show
Рет қаралды 1,2 МЛН
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 30 МЛН
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 18 МЛН
Top 10 Javascript One Liners YOU MUST KNOW!
14:16
developedbyed
Рет қаралды 195 М.
What is __proto__ ? | Javascript Prototypes Tutorial
23:11
Dave Gray
Рет қаралды 44 М.
Javascript Closure Tutorial | Closures Explained
17:58
Dave Gray
Рет қаралды 150 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 480 М.
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 509 М.
JavaScript Recursion Examples | Javascript Recursion Tutorial
19:02
Shallow Copy and Deep Copy | Advanced Javascript Tutorial
26:36
10 Essential React Native Tips Every Developer Must Know
12:07
Simon Grimm
Рет қаралды 11 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 4,5 МЛН