
JavaScriptを始めたころはprototypeオブジェクトが何なのかよく分からなかったけど、その名の通り「見本」あるいは「原型」なんだと分かれば、コンストラクタ関数とprototypeオブジェクトの関係は単純だと思える。 例として、人を表すオブジェクトを考えてみる。姓を表すlastNameプロパティと、名を表すfirstNameプロパティ、そしてそれらをつなげた文字列を返すgetFullNameメソッドを定義する。 var person = { firstName: '右京', lastName: '杉下', getFullName: function () { return this.lastName + ' ' + this.firstName; } }; さらに違う人物を表すオブジェクトを作ることになったとする。 var another = { firstName: '享',
This is the first entry in a series about writing JavaScript macros with sweet.js. You will learn how to write your first macro, basics of pattern matching, and how to run the sweet.js compiler and use sourcemaps for debugging. All of these tutorials are available in the sweet.js-tutorials repo along with a working environment to build sweet.js macros. The next tutorial is about recursive macros a
Motivation Consider the following synchronous JavaScript function to read a file and parse it as JSON. It is simple and easy to read, but you wouldn't want to use it in most applications as it is blocking. This means that while you are reading the file from disk (a slow operation) nothing else can happen. function readJSONSync(filename) { return JSON.parse(fs.readFileSync(filename, 'utf8')); } To
by Toby Ho on 1/23/2014 Hello, and welcome to the first post of Small.js! This post will cover the basics of Component. Component is a frontend Javascript package manager developed by the prolific Tj Holowaychuk. It embodies the philosophy of small modules and is designed to manage assets as well as Javascript. Currently, there exists over 1600 "components". Although there are more popular JS pack
Check out "Do you speak JavaScript?" - my latest video course on advanced JavaScript. Language APIs, Popular Concepts, Design Patterns, Advanced Techniques In the Browser I like the quote that the programming is all about managing complexity. Maybe you've heard that the computer world is a giant construction of abstractions. We simply wrap things and produce new tools over and over again. Just thi
Getting Started with Gulp This article will make the assumption that you have never used a build tool or command-line interface before and will walk through every step required to get up and running with gulp. The good news is that it is actually pretty simple! I have created five basic steps that walk you through all of the intimidating stuff and introduce you to the core ideas that you will need
この記事では、JavaScript - Client Side - Advent Calendar 2013の23日目の記事です。 さて、googkit を使ってカンタンに Closure Library での開発をはじめる方法を紹介します。 googkit は Closure Library を使った開発を手助けするツールです。私が前に開発した Webアプリケーション「piine! 」も Closure Library + googkit を使っています。 では、本題の googkit の説明に移る前に Closure Library の説明から始めましょう。 すばらしき Closure Library そもそも Closure Library ってばすごいライブラリなんですよ!!(白目 安心の Google 製 パリッとキマったクラス指向 var Child = function()
A couple of weeks ago, I wrote about how to do some basic static analysis of Javascript source code using Esprima. This post is a follow up where I demonstrate how to write a program to transforms Javascript source code using an Esprima-based library - falafel. Hello, Falafel Falafel is an AST traversal library like estraverse. If you've read my previous article, this is familiar territory. Instea
The :user_id part is called a dynamic segment because the corresponding user ID will be injected into the URL. So, it will look like /users/3/edit, where 3 is the user with the ID of 3. You can define either a route or a resource. Keep in mind that a resource is a group of routes and that it allows routes to be nested. A resource also resets the nested naming convention to the last resource name,
この記事は abicky.net の Perl 初心者がとある JavaScript コードを読むための基礎知識 に移行しました
We exist to give all people the freedom to belong, to connect with others, to share their passions and be accepted in a safe, trusted environment. We’re the technology and media company behind thousands of online communities and dating sites around the world. Through our portfolio of niche websites, apps and other channels, we help people live their happily ever now and build a better, more incl
Get affordable and hassle-free WordPress hosting plans with Cloudways — start your free trial today. The <table> element in HTML is used for displaying tabular data. You can think of it as a way to describe and display data that would make sense in spreadsheet software. Essentially: columns and rows. In this article, we’re going to look at how to use them, when to use them, and everything else you
March 31, 2025 in Learn New College Credit Courses From Treehouse Treehouse is excited to share a game-changing opportunity for students looking to advance their education while saving time and money! We have partnered with UPI to offer college credit courses, making it easier than ever to earn transferable credits while… Keeping up with the latest web development tools is crucial for building rob
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く