twilliability, to javascript
@twilliability@genart.social avatar

Question folks! If I use destructuring assignment as below, is an actual array allocated for the function's return value, or does the runtime recognize this and optimize it away?

Asking for a friend living in a tight loop.

const [a, b] = foo();

quesebifurcan,
@quesebifurcan@mastodon.social avatar

@twilliability I'm not sure if it matters in practice, but it looks like v8 has been optimizing array destructuring since 2018 https://v8.dev/blog/v8-release-68#array-destructuring-improvements

twilliability,
@twilliability@genart.social avatar

@quesebifurcan This is exactly what I was looking for, thanks! If V8 has had it for 6 years, then I assume it's the same in FF too.

eikun_0903, to javascript Japanese
@eikun_0903@fedibird.com avatar
nurkiewicz, to javascript
@nurkiewicz@fosstodon.org avatar

"Top 5 Cutting-Edge #JavaScript Techniques". TL;DR:

  1. Monads (Asynchronous Operations)
  2. Declarative Programming
  3. Server-Side Caching for Improved Node.js Performance
  4. Immutability
  5. Pattern Matching

https://thenewstack.io/top-5-cutting-edge-javascript-techniques/

awlex,

@nurkiewicz They should make programming languages where those techniques are enforced by default

aral, to SmallWeb
@aral@mastodon.ar.al avatar

New Video – Kitten features introduced this week:

• Interactive Shell (REPL)
• Multi-page Settings
• Backup and restore (data portability)

With examples that cover components and Kitten’s built-in JavaScript database (JSDB).

https://ar.al/2024/05/23/new-kitten-features-interactive-shell-repl-multi-page-settings-and-backup-and-restore-data-portability/

:kitten:💕

slacle, to genart
@slacle@mastodon.social avatar
aral, to SmallWeb
@aral@mastodon.ar.al avatar

So! Many! Kittens!

(Going to record a demo of the new interactive shell – REPL to some – and multi-page Settings this afternoon, just planning it out now.)

Oh and is that me creating and calling web routes interactively in the REPL on a live server? Why yes, yes it is.

:kitten:💕

#Kitten #SmallWeb #web #dev #HTML #CSS #JavaScript #NodeJS

markstos, to javascript
@markstos@urbanists.social avatar

Is EventEmitter the GOTO of #javascript ?

davesh,
@davesh@hachyderm.io avatar

@markstos yes and we like it

nucliweb, to javascript
@nucliweb@webperf.social avatar
aral, to SmallWeb
@aral@mastodon.ar.al avatar

:kitten: Kitten’s interactive shell (REPL) now saves session history scoped to your app so it will still be there when you next serve the same app.

https://codeberg.org/kitten/app#kitten-s-interactive-shell

I think I’m done with the REPL feature now.

Going to take a little break, step away from the computer, and make a plan for the next week of work on Kitten and Domain¹.

¹ https://codeberg.org/domain/app

stvfrnzl, to webdev
@stvfrnzl@mastodon.online avatar

I finally got for @astro working! Thanks to @henry sparking my interest for it (again) and anyone here who helped me along the way.

https://stevefrenzel.dev/posts/webmentions-in-astro-for-blog-posts/

I would appreciate lots of likes, reposts and comments so I have more data to work with hehe
😈

stvfrnzl,
@stvfrnzl@mastodon.online avatar

@kevinleedrum ooohh ok, thanks for clearing it up! 💪

stvfrnzl,
@stvfrnzl@mastodon.online avatar

@kevinleedrum awesome, I appreciate it! I still want to add how to create a GitHub action that runs a build every 24 hours, but I'm so bad at this haha

Once I figured it out, I'll edit my article

rauschma, to javascript
@rauschma@fosstodon.org avatar

Upcoming iterator methods:

// Without iterator methods:
const arr = Array.from(myMap.keys())
.filter(k => isPublic(k));

// With iterator methods:
const arr = myMap.keys()
.filter(k => isPublic(k))
.toArray();

(I prefer not to do .filter(isPublic) because isPublic() may gain more parameters in the future.)

https://2ality.com/2022/12/iterator-helpers.html

voxpelli,
@voxpelli@mastodon.social avatar

@rauschma I have been looking forward to these!

I assume they don’t work with AsyncIterators?

marmelab, to php
@marmelab@mastodon.social avatar

🎉 Exciting news! Marmelab is sponsoring the API Platform Conference 2024, the flagship event dedicated to the API Platform framework!

Join us for 2 days of talks by leading experts in , & .

📅 19 & 20 September
📍 Lille, France

Learn more: https://api-platform.com/fr/con/2024/

@cooptilleuls

nucliweb, to javascript
@nucliweb@webperf.social avatar

async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

https://gist.github.com/jakub-g/385ee6b41085303a53ad92c7c8afd7a6

ramikrispin, to datascience
@ramikrispin@mstdn.social avatar

Getting Started with Observable Framework 👇🏼

Here is a great resource for getting started with Observable Framework by Allison Horst. Observable Framework is an open-source JS library for creating dashboards. The sequence of videos covers how to set up a project and data loader, customize the dashboard, and deploy it.

📽️ https://www.youtube.com/playlist?list=PLOHIJAFwtkEcuVZO6WK-Uuswd09Y2Rk2b

#DataScience #dataviz #JavaScript #Observable

scy, to javascript
@scy@chaos.social avatar

Theo on const vs let in :

https://youtu.be/dqmtzHB2zTM (32 min).

It's a long video, and he's basically only reacting to and commenting on Let me be https://www.epicweb.dev/talks/let-me-be (12 min) by Ryan Florence.

Theo's main point is that const doesn't mean "this value will never change" (since objects and arrays can obviously still be mutated), but that let means "pay attention, this value will be reassigned further down", and I totally agree.

sebsch,
@sebsch@chaos.social avatar

@scy is there anything in that language that is not partially broken?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines