Skip to content
Advertisement

Tag: javascript

Why `muted` attribute on video tag is ignored in React?

Well, as counter-intuitive as it sounds, muted tag is somehow ignored; check out the snippet below, first one is rendered with react, the second one regular html; inspect them with your dev tools, and you see the react on doesn’t have muted attribute; I already tried muted={true}, muted=”true” but non is working. Answer This is actually a known issue which

Is there a way to pass multiple (and different) parameters to an Apex Controller class from JS in Lightning Web Components (LWC)?

I’m currently stuck at a problem and was hoping someone here could help me. I also certainly hope this is the right place to ask it. I’m trying to create a custom Invoice record with its corresponding Invoice Line records upon firing an event. I already have some logic in place to gather ID of selected rows in the JS.

When should I use ?? (nullish coalescing) vs || (logical OR)?

Related to Is there a “null coalescing” operator in JavaScript? – JavaScript now has a ?? operator which I see is in use more frequently. Previously most JavaScript code used ||. In what circumstances will ?? and || behave differently? Answer The OR operator || uses the right value if left is falsy, while the nullish coalescing operator ?? uses

Why use readFileAsync to read file with json inside in Node.js?

I was learning Node.js and was watching Node.js course where an author used the below code: As you can see the code above, we first try to parse the json by reading the file synchronously. The author said that if we use const tours = JSON.parse(fs.readFileSync(‘data.json’)); inside callback of get() then event loop would be blocked since callbacks are executed

NextJS – Appending a query param to a dynamic route

In my NextJS app, I have a language selector that’s visible on every page. When I select a new language, I just want to replace the current URL by appending a query param lang=en to it. Here’s the function that replaces the URL: In this example, replace, query and pathname are coming from the next router. Now, everything works for

Advertisement