One of the most POWERFUL features of JavaScript...

  Рет қаралды 8,479

dcode

dcode

Күн бұрын

Пікірлер: 45
@jameswan2963
@jameswan2963 2 жыл бұрын
I watch a video everyday after I find this channel It is like a treasure vault for programming people
@dcode-software
@dcode-software 2 жыл бұрын
That's awesome, thanks!
@عبدالقادرعبدالرحمنعبدالله
@عبدالقادرعبدالرحمنعبدالله 2 жыл бұрын
Powerful function with powerful explanation by powerful man. Thanks for sharing.
@dcode-software
@dcode-software 2 жыл бұрын
🤣🤣 thank you!!
@عبدالقادرعبدالرحمنعبدالله
@عبدالقادرعبدالرحمنعبدالله 2 жыл бұрын
@@dcode-software welcome, really love your contents. I am also js developer.
@qxb348
@qxb348 2 жыл бұрын
first?
@adnantariq3346
@adnantariq3346 Жыл бұрын
So it’s a cool example, thank you. But given the trend, that is typescript is now mostly used instead of JavaScript, how hard or how much more overhead would there be to write this in typescript? Just wondering.
@nyxandtyr
@nyxandtyr 2 жыл бұрын
Good stuff, but now I need a video on regular expressions.
@2ncielkrommalzeme210
@2ncielkrommalzeme210 2 жыл бұрын
blue background light is awsome. it suited so good
@renanbrayner984
@renanbrayner984 2 жыл бұрын
How many times did he said "so" in this vídeo?
@Rudxain
@Rudxain 2 жыл бұрын
I usually do `str.replace(/./gs, c => dict[c] || c)`. It's a common idiom to replace chars based on a dictionary mapping. The regex I used guarantees that there's no conditional branching (because of "dot-all" flag), substantially increasing iteration performance. But be careful when iterating strings (in any way, not just the idiom I showed), because some JS functions iterate over code-units (split), code-points (spread syntax, and `for of` loops), or grapheme clusters (Intl.segmenter)
@bulent2435
@bulent2435 2 жыл бұрын
never knew. thanks.
@joeys.4268
@joeys.4268 2 жыл бұрын
Every time I think I know JavaScript, I watch one of your seemingly benign videos and learn something new. Thanks!
@chanandlerbong6176
@chanandlerbong6176 2 жыл бұрын
how is your cursor moving slowly from one character to another?
@dcode-software
@dcode-software 2 жыл бұрын
It's the VS Code setting which is called "cursorSmoothCaretAnimation"
@diallomamadou258
@diallomamadou258 2 жыл бұрын
Being using replace for long time and I never knew about that callback function. Thank you for this treasure.
@mirkosedda3196
@mirkosedda3196 2 жыл бұрын
Isnt using a map function better for these cases?
@dcode-software
@dcode-software 2 жыл бұрын
Possibly, there are always other ways to do things. As I mentioned in another comment, this video is to demonstrate the usage of the replacer function but doesn't guarantee its the best way to do something
@Pareshbpatel
@Pareshbpatel 6 ай бұрын
{2024-03-25}
@RodrigoSilva-un9xh
@RodrigoSilva-un9xh 2 жыл бұрын
Amazing!!!
@jameswan2963
@jameswan2963 2 жыл бұрын
+"3" turns string into number
@dcode-software
@dcode-software 2 жыл бұрын
Yes you could also do this 🙂
@mhdfr
@mhdfr 2 жыл бұрын
or multiply by 1, no? xD
@flamess007
@flamess007 2 жыл бұрын
Nice one!!, thank you I just liked your video
@hugodsa89
@hugodsa89 2 жыл бұрын
dude this could really be done in such a better way. instead of selecting all digits to begin with why not allow the regex to select only even numbers?
@dcode-software
@dcode-software 2 жыл бұрын
If it was up to me, yes I would do it that way but the point of this video is to show an example of how this function is used, not so much the intention of trying to only replace even numbers.
@hugodsa89
@hugodsa89 2 жыл бұрын
@@dcode-software fair point.
@gillesa290
@gillesa290 2 жыл бұрын
Very useful. Thank you very much for sharing
@mdkawsarislamyeasin4040
@mdkawsarislamyeasin4040 2 жыл бұрын
Thanks need more video lile this 😌 Awesome video
@dcode-software
@dcode-software 2 жыл бұрын
Awesome, thank you! I plan to make more shorter videos highlighting lesser known parts of JavaScript so stay tuned 🙂
@mdkawsarislamyeasin4040
@mdkawsarislamyeasin4040 2 жыл бұрын
@@dcode-software plz make full playlist about DSA 😌
@維倫劉
@維倫劉 2 жыл бұрын
Thanks for sharing!
@dcode-software
@dcode-software 2 жыл бұрын
You're welcome
@zhunter8596
@zhunter8596 2 жыл бұрын
Thnxs for new information
@anush8
@anush8 2 жыл бұрын
Amazing.
@dcode-software
@dcode-software 2 жыл бұрын
Glad you think so!
@pratikwadekar4981
@pratikwadekar4981 2 жыл бұрын
This video is a treasure trove!! Thanks man
@dcode-software
@dcode-software 2 жыл бұрын
Happy it helped you 🙂
@adehenry9591
@adehenry9591 2 жыл бұрын
Very cool replacer function 😎
@dcode-software
@dcode-software 2 жыл бұрын
I think so too!
@jul1o651
@jul1o651 2 жыл бұрын
Cool video, thanks
@dcode-software
@dcode-software 2 жыл бұрын
No problem 👍
@SonAyoD
@SonAyoD 2 жыл бұрын
Great video! More please bro!
@dcode-software
@dcode-software 2 жыл бұрын
Will do 👀
Every JavaScript Dev Should Know This (Defer Attribute)
5:33
12 Things Every JavaScript Developer Should Know
14:29
dcode
Рет қаралды 10 М.
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,6 МЛН
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 11 МЛН
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Another 5 Must Know JavaScript Array Methods
14:24
dcode
Рет қаралды 4,4 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 84 М.
5 Must Know JavaScript Features That Almost Nobody Knows
18:06
Web Dev Simplified
Рет қаралды 476 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 812 М.
Inheritance in JavaScript - Prototypal Inheritance tutorial
20:06
Closures in JS 🔥 | Namaste JavaScript Episode 10
22:44
Akshay Saini
Рет қаралды 835 М.
5 Real Life Examples of Array Reduce in JavaScript
12:47
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Learn React Hooks: useCallback - Simply Explained!
17:15
Cosden Solutions
Рет қаралды 94 М.
Node.js Doesn’t Suck Anymore
16:59
Web Dev Simplified
Рет қаралды 114 М.