随笔分类 -  JavaScript

摘要:Filter, map, and reduce is three of Higher Order Function that often uses. The three functions of these is a prototype of the array data type. Althoug 阅读全文
posted @ 2020-05-24 16:16 PrimerPlus 阅读(96) 评论(0) 推荐(0)
摘要:Implementing JavaScript inheritance using and Prior to ES6, implementing a proper inheritance required multiple steps. One of the most commonly used s 阅读全文
posted @ 2020-05-18 18:03 PrimerPlus 阅读(280) 评论(0) 推荐(0)
摘要:ECMAScript 6 "git.io/es6features" Introduction ECMAScript 6, also known as ECMAScript 2015, is the latest version of the ECMAScript standard. ES6 is a 阅读全文
posted @ 2020-05-14 15:35 PrimerPlus 阅读(106) 评论(0) 推荐(0)
摘要:Class basic syntax Wikipedia In object oriented programming, a class is an extensible program code template for creating objects, providing initial va 阅读全文
posted @ 2020-05-08 16:49 PrimerPlus 阅读(119) 评论(0) 推荐(0)
摘要:什么是闭包 维基百科中的概念 在计算机科学中,闭包(英语:Closure),又称词法闭包(Lexical Closure)或函数闭包(function closures),是在支持头等函数的编程语言中实现词法绑定的一种技术。闭包在实现上是一个结构体,它存储了一个函数(通常是其入口地址)和一个关联的环 阅读全文
posted @ 2020-05-07 17:22 PrimerPlus 阅读(181) 评论(0) 推荐(0)
摘要:Floyd's Triangle Floyd’s triangle is a right angled triangular array of natural numbers. Floyd's triangle是自然数的直角三角形数组 It is defined by filling the row 阅读全文
posted @ 2020-05-07 00:10 PrimerPlus 阅读(236) 评论(0) 推荐(0)
摘要:let和const 1、ES6新增了let命令,用来声明变量。它的用法类似于 "var" ,但是所声明的变量,只在let命令所在的代码块内有效。下面代码在代码块之中,分别用let和var声明了两个变量。然后在代码块之外调用这两个变量,结果let声明的变量报错,var声明的变量返回了正确的值。这表明, 阅读全文
posted @ 2020-05-06 23:45 PrimerPlus 阅读(110) 评论(0) 推荐(0)
摘要:Map Prior to ES6, when we require the mapping of keys and values, we often use an object. It is because the object allows us to map a key to the value 阅读全文
posted @ 2020-05-06 17:42 PrimerPlus 阅读(157) 评论(0) 推荐(0)
摘要:Closures Closures are one of the most powerful features of JavaScript. JavaScript allows for the nesting of functions and grants the inner function fu 阅读全文
posted @ 2020-04-29 15:01 PrimerPlus 阅读(79) 评论(0) 推荐(0)
摘要:Introduction to Object Oriented Programming in JavaScript As JavaScript is widely used in Web Development, in this article we would explore some of th 阅读全文
posted @ 2020-04-27 17:22 PrimerPlus 阅读(206) 评论(0) 推荐(0)
摘要:Higher Order Functions A function that accepts and/or returns another function is called a higher order function. It's higher order because instead of 阅读全文
posted @ 2020-04-27 13:45 PrimerPlus 阅读(153) 评论(0) 推荐(0)
摘要:Exercise 01 Max Of Two Numbers Write a function that takes two numbers and returns the maximum of the two Exercise 02 Landscape or Portrait Exercise 0 阅读全文
posted @ 2020-04-26 14:13 PrimerPlus 阅读(204) 评论(0) 推荐(0)
摘要:DecimalToBinary javascript function decimalToBinary(num) { var bin = []; while (num 0) { bin.unshift(num % 2); num = 1; // basically /= 2 without rema 阅读全文
posted @ 2020-04-24 14:44 PrimerPlus 阅读(140) 评论(0) 推荐(0)
摘要:Exercise 1 Write a JavaScript program to display the current day and time in the following format. Today is : Tuesday. Current time is : 2PM : 21 : 38 阅读全文
posted @ 2020-04-24 14:23 PrimerPlus 阅读(110) 评论(0) 推荐(0)
摘要:Exercise 01 with Solution Write a JavaScript program to compare two objects to determine if the first one contains equivalent property values to the s 阅读全文
posted @ 2020-04-23 10:11 PrimerPlus 阅读(52) 评论(0) 推荐(0)