Javascript 個人リファレンス

目次

標準組み込みオブジェクト

Array

配列風オブジェクトを配列に展開する

function list() {
  return Array.prototype.slice.call(arguments);
	return [].slice.call(arguments);
}

var list1 = list(1, 2, 3);

Object

const obj = new Object;

obj.__prot__ = Object.prototype;

Object.prototype = window.Object.prototype;

// 要素を監視する
// Object.defineProperty

Function

(function(){}).toString === Function.prototype.toString;

call( )は指定したtargetObjectのfunctionを引数(thisObj)のメソッドであるかのように呼び出す

targetObject.function.call(thisObj,args...);

// .slice はFunctionをextendしているので、callを実行できる
Array.prototype.slice.call(arguments);

Web API

URLSearchParams