Tagged “js”
-
TIL why you should always use textContent js text
Today I learned the difference between 'Node.textContent'. It handles all elements, even hidden ones. It also prevents XSS attacks since it strips tags.
-
TIL prepend html js dom
When you're creating new elements in Javascript, you want to attach the new element to something that exists in the DOM already. You do that with append, and prepend.
-
TIL the simulating a Pipe function js functionalprogramming
It’s a pipe function that allows you to chain multiple operations together by taking a series of functions as arguments and applying them in a specific order to the input.
-
TIL Windowing in Browsers js performance
Windowing only allow you to render what's available. Using twitter as a example, with tweets, when you scroll through hundreds of tweets and inspect the DOM, they just put a bunch of blank space above so there's not like 400 tweets above you.
-
TIL super() mdn oop js
When you use super(), it's like you're telling the new object to copy everything from the old object first, and then add or change anything else that's different.
-
TIL How to check if the string is uppercase js text
The magic is comparing str === str.toUpperCase()
-
TIL how to remove a event listener js events
Maybe you have a situation where you only want the event to fire once.
-
TIL Optional Chaining in PHP8 php js
Optional Chaining in PHP looks very similar to optional chaining in JS
-
TIL the Capitalize String shortcut js
JavaScript doesn’t have a function that allows you to capitalize a string
-
TIL chaining Vue 3 Main.js vue js
Vue's Main.js file looks slightly different. Here is how to modify it.
-
TIL how to check if a dom element has a specific class js css
How to destructure the classList into an array so you can use include()
-
TIL Waiting for video to load event listeners js
I discovered the Media Events `loadedmetadata, loadeddata, canplay, canplaythrough`
See all tags.