Top Tweets for #DailyJS
daily js - includes vs some
some checks if any of the item matches the condition
includes checks if the item is present in the array
const nums = [1, 2, 3];
nums.some(n => n > 2); // true
nums.includes(2); // true
#day29 #frontend #dailyjs #javascript
daily js - includes vs find
includes checks if the value is present in the array, returns true or false
find returns the first item matching the condition
const nums = [1, 2, 3, 4];
nums.includs(1) - true
nums.find(n => n>2) - 3
#day28 #frontend #dailyjs #javascript
daily js : == vs ===
== : compares values only
=== : compares value and type
0 == "0" // true
0 === "0" // false
#Day27 #frontend #dailyjs #javascript
daily js - undefined vs null
undefined - JS says: “value not assigned yet”
null - Developer says: “I’m intentionally setting this to nothing”
#Day26 #frontend #dailyjs #javascript
daily js - lazy loading
Loading a piece of code only when it is needed.
example:
home page loads first
profile page loads only when you open it
- faster page load
- smaller initial bundle
#Day25 #frontend #dailyjs #javascript
- sayHello is not inside p1 or p2
- it is added to Person.prototype
- javascript finds it using __proto__
prototype is a property of a function used to share methods across all its objects.
#Day21 #webdev #JavaScript #DailyJS #Frontend
This lookup process is called prototype chain
__proto__ is a hidden link that JavaScript uses to find missing properties.
#DailyJS #Day20 #JavaScript #WebDev
Daily JS - Array Holes
A hole in a JavaScript array means an item is missing, not empty.
Example: [ , , ] has two positions, but nothing is actually stored there.
This is different from [undefined, undefined], where values exist.
#Frontend #JavaScript #DailyJS #Day17
- You can mutate objects & arrays declared with const
- You just can’t reassign them
Mutating const objects can cause subtle bugs
If you want real immutability, use
Object.freeze(obj);
#JavaScript #Frontend #DailyJS #WebDev
Daily JS - Const
const does NOT mean immutable
It only means the reference can’t change.
const user = { name: "Ram" };
user?.name = "Shyam"; // allowed
user?.age = 25; // allowed
user = {}; // error
(1/2)
#Frontend #JavaScript #Day16 #DailyJS
Daily JS - Tree Shaking
removes unused code from your final bundle.
example:
import { add, subtract } from './math';
add(2, 3);
You never use subtract.
tree shaking removes subtract completely from the final build.
#JavaScript #Frontend #DailyJS #Day15
Daily JS - minification 🤏
means removing all the unnecessary characters from your code, like spaces, comments and long variable names without changing how it works. it makes the file smaller and website loads faster
#Dailydev #Javascript #DailyJS #Day3
i’m not streaming today. i feel tired (i had to train crypto bot at 3m, because the coin listening was a that time) but i had some progress with Shark Tank AI Simulator, I found #boltnew is using @travus with #dailyjs so the implementation has been more challenging than expected . but the result is awesome, tomorrow will show you how to implement @getsentry and @RevenueCat with Bolt
javascript string functions;
localeCompare: Compares two strings in the current locale.
#javascript #tips #webprogramming #dailyjs

javascript string functions;
search: Searches for specified value in the string.
#javascript #tips #webprogramming #dailyjs

javascript string functions;
concat: Concatenates the arguments to the calling string.
#javascript #tips #webprogramming #dailyjs

Last Seen Hashtags on Sotwe
Most Popular Users

Elon Musk 
@elonmusk
240.1M followers

Barack Obama 
@barackobama
119.3M followers

Donald J. Trump 
@realdonaldtrump
111.6M followers

Cristiano Ronaldo 
@cristiano
108.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
97.2M followers

NASA 
@nasa
92.1M followers

Justin Bieber 
@justinbieber
90.5M followers

KATY PERRY 
@katyperry
86.7M followers

Taylor Swift 
@taylorswift13
80.5M followers

Lady Gaga 
@ladygaga
72.1M followers

Kim Kardashian 
@kimkardashian
69.3M followers

YouTube 
@youtube
68.6M followers

Virat Kohli 
@imvkohli
68.4M followers

Bill Gates 
@billgates
63.3M followers

The Ellen Show
@theellenshow
62.5M followers

CNN 
@cnn
61.9M followers

Neymar Jr 
@neymarjr
60.9M followers

X 
@x
60.9M followers

CNN Breaking News 
@cnnbrk
59.9M followers


