並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 21 件 / 21件

新着順 人気順

how to get array index in foreach javascriptの検索結果1 - 21 件 / 21件

  • Google TypeScript Style Guide

    // Good: choose between two options as appropriate (see below). import * as ng from '@angular/core'; import {Foo} from './foo'; // Only when needed: default imports. import Button from 'Button'; // Sometimes needed to import libraries for their side effects: import 'jasmine'; import '@polymer/paper-button'; Import paths TypeScript code must use paths to import other TypeScript code. Paths may be r

    • Prettier 3.0: Hello, ECMAScript Modules! · Prettier

      We are excited to announce the release of the new version of Prettier! We have made the migration to using ECMAScript Modules for all our source code. This change has significantly improved the development experience for the Prettier team. Please rest assured that when using Prettier as a library, you can still use it as CommonJS as well. This update comes with several breaking changes. One notabl

        Prettier 3.0: Hello, ECMAScript Modules! · Prettier
      • WebAssembly: Docker without containers!

        This is a companion article to a talk about Docker+WebAssembly that we gave at "Docker Community All Hands 7, Winter Edition" on Dec 15th, 2022. Introduction Recently Docker announced support for WebAssembly in cooperation with WasmEdge. This article will explain what is WebAssembly, why it is relevant to the Docker ecosystem and provide some hands-on examples to try on. We assume you are familiar

          WebAssembly: Docker without containers!
        • JS Self-Profiling API In Practice

          Nic Jansma (@nicj) is a software developer at Akamai building high-performance websites, apps and open-source tools. Table of Contents The JS Self-Profiling API What is Sampled Profiling? Downsides to Sampled Profiling API Document Policy API Shape Sample Interval Buffer Who to Profile When to Profile Specific Operations User Interactions Page Load Overhead Anatomy of a Profile Beaconing Size Comp

            JS Self-Profiling API In Practice
          • A virtual DOM in 200 lines of JavaScript

            In this post I’ll walk through the full implementation of a Virtual DOM in a bit over 200 lines of JavaScript. The result is a full-featured and sufficiently performant virtual DOM library (demos). It’s available on NPM as the smvc package. The main goal is to illustrate the fundamental technique behind tools like React. React, Vue and the Elm language all simplify the creation of interactive web

            • How MDN’s autocomplete search works – Mozilla Hacks - the Web developer blog

              Last month, Gregor Weber and I added an autocomplete search to MDN Web Docs, that allows you to quickly jump straight to the document you’re looking for by typing parts of the document title. This is the story about how that’s implemented. If you stick around to the end, I’ll share an “easter egg” feature that, once you’ve learned it, will make you look really cool at dinner parties. Or, perhaps y

                How MDN’s autocomplete search works – Mozilla Hacks - the Web developer blog
              • All JavaScript and TypeScript Features of the last 3 years

                TypeScript as envisioned by Stable DiffusionThis article goes through almost all of the changes of the last 3 years (and some from earlier) in JavaScript / ECMAScript and TypeScript . Not all of the following features will be relevant to you or even practical, but they should instead serve to show what’s possible and to deepen your understanding of these languages. There are a lot of TypeScript fe

                  All JavaScript and TypeScript Features of the last 3 years
                • Weird Lexical Syntax

                  I just learned 42 programming languages this month to build a new syntax highlighter for llamafile. I feel like I'm up to my eyeballs in programming languages right now. Now that it's halloween, I thought I'd share some of the spookiest most surprising syntax I've seen. The languages I decided to support are Ada, Assembly, BASIC, C, C#, C++, COBOL, CSS, D, FORTH, FORTRAN, Go, Haskell, HTML, Java,

                    Weird Lexical Syntax
                  • Parsing SQL - Strumenta

                    The code for this tutorial is on GitHub: parsing-sql SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. In this article we will talk about parsing SQL. It is in the same league of HTML: maybe you never learned it formally but you kind of know how to use it. That is great because if you know SQL, you know how to handle data. However

                      Parsing SQL - Strumenta
                    • JavaScript needs more helper functions for iteration (map, filter, etc.) – where should we put them?

                      JavaScript needs more helper functions for iteration (map, filter, etc.) – where should we put them? Iteration is a standard that connects operations with data containers: Each operation that follows this standard, can be applied to each data container that implements this standard. In this blog post: We first explore three questions: How does JavaScript’s iteration work? What are its quirks? What

                      • How video games use LUTs and how you can too

                        Look-up-tables, more commonly referred to as LUTs, are as old as Mathematics itself. The act of precalculating things into a row or table is nothing new. But in the realm of graphics programming, this simple act unlocks some incredibly creative techniques, which both artists and programmers found when faced with tough technical hurdles. We’ll embark on a small journey, which will take us from simp

                          How video games use LUTs and how you can too
                        • Cloudflare functions with Scala.js

                          Indoor VivantsAnton Sviridov. I love reinventing the wheel and I usually use Scala for that. TL;DR We are deploying an app to Cloudflare using Scala.js We are using ScalablyTyped We are using Scala 3 heavily Code on Github Deployed app Cloudflare API bindings Welcome to the "Put ma Scala on yo cloud" series I want to say that I'm kicking off a blog series, but even I don't believe that. If I did,

                          • A Small Guide for Naming Stuff in Front-end Code

                            Reading Time: 9 minutes Phil Karlton has famously said that the two hardest things in computer science are naming things and cache invalidation1. That’s still kinda true in front-end development. Naming stuff is hard, and so is changing a class name when your stylesheet is cached. For quite a few years, I’ve had a gist called “Tiny Rules for How to Name Stuff.” Which is what you think: little tiny

                              A Small Guide for Naming Stuff in Front-end Code
                            • 8.x バリデーション Laravel

                              イントロダクションIntroduction Laravelは、アプリケーションの受信データをバリデーションするために複数の異なるアプローチを提供します。すべての受信HTTPリクエストで使用可能なvalidateメソッドを使用するのがもっとも一般的です。しかし、バリデーションに対する他のアプローチについても説明します。Laravel provides several different approaches to validate your application's incoming data. It is most common to use the validate method available on all incoming HTTP requests. However, we will discuss other approaches to validation as well

                              • Google TypeScript Style Guide

                                // Good: choose between two options as appropriate (see below). import * as ng from '@angular/core'; import {Foo} from './foo'; // Only when needed: default imports. import Button from 'Button'; // Sometimes needed to import libraries for their side effects: import 'jasmine'; import '@polymer/paper-button'; Import paths TypeScript code must use paths to import other TypeScript code. Paths may be r

                                • Replace JavaScript Dialogs With New HTML Dialog | CSS-Tricks

                                  Get affordable and hassle-free WordPress hosting plans with Cloudways — start your free trial today. You know how there are JavaScript dialogs for alerting, confirming, and prompting user actions? Say you want to replace JavaScript dialogs with the new HTML dialog element. Let me explain. I recently worked on a project with a lot of API calls and user feedback gathered with JavaScript dialogs. Whi

                                    Replace JavaScript Dialogs With New HTML Dialog | CSS-Tricks
                                  • Big O

                                    Big O notation is a way of describing the performance of a function without using time. Rather than timing a function from start to finish, big O describes how the time grows as the input size increases. It is used to help understand how programs will perform across a range of inputs. In this post I'm going to cover 4 frequently-used categories of big O notation: constant, logarithmic, linear, and

                                      Big O
                                    • How fast is javascript? Simulating 20,000,000 particles

                                      How fast is javascript? Simulating 20,000,000 particles The challenge, simulate 1,000,000 particles in plain javascript at 60 fps on a phone using only the cpu. Let's go. Ok, this is not a particularly difficult challenge if you did all the work on a gpu but the rule of the challenge is to use the CPU only or as much as possible and to stay in js land so no wasm. I know what you are thinking. This

                                        How fast is javascript? Simulating 20,000,000 particles
                                      • CommonJS to ESM in Node.js

                                        Yesterday, I refactored Place1, which is a non-trivial Node.js app, to use ECMAScript Modules (ESM). Here’s a diff of the full set of changes. This is the approach I took and some of the issues I ran into, in case it helps someone else: Find and replace First off, I started by running the following regular expression2 to quickly convert CommonJS require syntax to ESM import syntax: Find const (.*?

                                          CommonJS to ESM in Node.js
                                        • Static site generation with React from scratch - LogRocket Blog

                                          If you ask me what framework has the best component model, I’d say React without hesitating. There are various reasons for this. On the one hand, React makes components without much ceremony and compromises. The model is also pretty much independent of React. With the new JSX factory, you wouldn’t even see an import of React in TypeScript or Babel. Obviously, there must be one caveat when it comes

                                            Static site generation with React from scratch - LogRocket Blog
                                          • ECMAScript proposal: iterator helpers

                                            Update 2022-12-15: New section “How will this proposal affect future JavaScript APIs?” In this blog post, we look at the ECMAScript proposal “Iterator helpers” by Gus Caplan, Michael Ficarra, Adam Vandolder, Jason Orendorff, Kevin Gibbons, and Yulia Startsev. It introduces utility methods for working with iterable data: .map(), .filter(), .take(), etc. The style of the proposed API clashes with th

                                            1