CSS Gradient Text

Web developers know the fight we’ve all had to improve fonts on the web. Whether it be load time, odd strategies for using custom fonts (Cufon, anyone?), or just finding the right font itself, beautifying text on the web has never come easy. That got me thinking about fonts and CSS gradients, since gradients also […]
The post CSS Gradient Text appeared first on David Walsh Blog.

Link: https://davidwalsh.name/css-gradient-text

Detect if Element is a Web Component

I’ve advocated for web components since before they became a spec, mostly inspired by the Dojo Toolkit’s dijit framework. Empowering first class JavaScript widgets, as opposed to a mess of DIVs and templates, always made the most sense. Now that web components exist, and awesome frameworks like Ionic are based on them, I wanted to […]
The post Detect if Element is a Web Component appeared first on David Walsh Blog.

Link: https://davidwalsh.name/detect-web-component

What Is Code?

Sometimes, it feels like people who can code seem like they have superpowers. But what is code, anyway? Code is all around us. Code is used in things like computers, phones, self-driving cars, and all other…
The post What Is Code? appeared first on Treehouse Blog.

Link: https://blog.teamtreehouse.com/what-is-code

Recursive Array.flat

There was much talk about Array.prototype.flat during its early stages, starting with the name alone. Many developers preferred the name flatten but the spec differed from MooTools’ implementation. MooTools would recursively flatten an array but the new, official flat implementation was only one level of flattening. The current implementation of Array.prototype.flat is: [1, 2, [3], […]
The post Recursive Array.flat appeared first on David Walsh Blog.

Link: https://davidwalsh.name/recursive-array-flat

Using Array reduce

Every developer who specializes in any programming language will tell you there’s a powerful tool the language provides that they rarely use and wish they knew more about. For me, it’s Array.prototype.reduce. I quite enjoy the other Array methods like map, filter, and find, but reduce is one that I knew was powerful but never […]
The post Using Array reduce appeared first on David Walsh Blog.

Link: https://davidwalsh.name/using-array-reduce

Type Conversion with JavaScript Arrays

JavaScript’s loose nature allows developers to employ amazing tricks to do just about anything you’d like. I’ve detailed how you can filter falsy values in arrays using a filter(Boolean) trick, but reader David Hibshman shared another trick for typecasting array values the same way. To typecast an array of elements, you can use map and […]
The post Type Conversion with JavaScript Arrays appeared first on David Walsh Blog.

Link: https://davidwalsh.name/javascript-array-typecast

How to Reverse a Video

One of my favorite media utilities is ffmpeg. This command line utility allows us to do some pretty amazing stuff like; Slice videos Convert video formats Modify video speed Combine audio and video Every once in a while I see a meme or funny video that reverses a video for effect. Since ffmpeg does just […]
The post How to Reverse a Video appeared first on David Walsh Blog.

Link: https://davidwalsh.name/reverse-video

JavaScript Detect Async Function

JavaScript async/await has changed the landscape of how we code. We’re no longer stuck in callback or then hell, and our code can feel more “top down” again. Async functions require the following syntax: async function myFunction() { } To use await with a function, the function needs to be declared with async. That got […]
The post JavaScript Detect Async Function appeared first on David Walsh Blog.

Link: https://davidwalsh.name/javascript-detect-async-function