Question 3 - The Idea and Practice of Converting ES6 Code into ES5
Interview topics:
What is the idea of converting ES6 code to ES5 code?
Examples:
// Before conversion
const fn = () => {
console.log('The Lion of the Front End');
};
// After conversion
"use strict";
var fn = function fn() {
console.log('The Lion of the Front End');
};
Answer analysis:
...
Posted by dourvas on Tue, 13 Aug 2019 05:59:15 +0200
Dynamic Features in C#
Original Link: http://www.cnblogs.com/jellochen/p/The-Dynamic-Feature-in-CSharp.html
As we all know, C#is a static language just like Java.Before C# 4.0, you want to and Dynamic Language Convenient interoperability (such as Python, Java ...
Posted by furiousweebee on Tue, 23 Jul 2019 18:26:35 +0200
array of javascript
Create arrays
Use literal grammar and Array() constructors.
Literal
Using array literals is the easiest way to create arrays. You can use all the elements in square brackets to separate them.
var s = [];//Empty array
var s = [1,1,1,1,1]//An array with five values.
Although javascript arrays are ordered lists of data in other languages, ...
Posted by bigfatpig on Mon, 15 Jul 2019 19:52:00 +0200
Detailed usage of apply and call in js
From here...
Preface
call and apply exist to change the context in which a function runs, that is, to change the direction of this inside the function.call and apply work exactly the same, but they accept parameters differently.
Method Definition
applyThe Function.apply(obj,args) method can take two parameters:
obj: This object will replac ...
Posted by TheJoey on Sat, 13 Jul 2019 18:23:19 +0200
Common JavaScript String Operations
JavaScript strings are used to store and process text. So when you write JS code, she always goes hand in hand, when you process user's input data, when you read or set the attributes of DOM objects, when you operate Cookie, when you convert different Date s, and so on, countless; and her many API s, there are always some impulses that people d ...
Posted by music_man on Sat, 13 Jul 2019 01:31:07 +0200
JavaScript - Native Array Object Method Details (1)
1,join()
join() Method is used to convert all elements in an array into a string. Elements are delimited by a specified delimiter.arrayObject.join(separator)The parameter represents the separator and is optional. Default comma if no parameters are passed.
Note that the return value is a string, not an array.Note: This method does not change the ...
Posted by rrhody on Mon, 08 Jul 2019 20:21:24 +0200
(32)Vue template syntax
Template syntax
Text:
<span>Message: {{ msg }}</span>
v-once
One-time interpolation, when the data changes, the contents of the interpolation will not be updated
<span v-once>This will not change: {{MSG}}</span>
v-html directive
<p>Using mustaches: {{ rawHtml }}</p>
<p>Using v-html direct ...
Posted by dgny06 on Mon, 08 Jul 2019 18:18:08 +0200
TypeScript class usage collation
Class I Introduction
Traditional JavaScript programs use functions and prototype-based inheritance to create reusable components.
Starting with ECMAScript 2015, or ECMAScript 6, JavaScript programmers will be able to use the object-oriented approach of classes. But TypeScript allows you to use these features now, without waiting for the next ...
Posted by pthurmond on Wed, 19 Jun 2019 02:31:29 +0200
js object-oriented and prototype inheritance learning notes.
create object
Although Object constructors or object literals can be used to create a single object, these methods have obvious drawbacks: creating many objects with the same interface can generate a lot of duplicate code. To solve this problem, people began to use a variant of the factory model.
Factory mode
Factory pattern is a well-known des ...
Posted by Rangel on Sat, 18 May 2019 00:13:47 +0200
Preliminary guide to JavaScript prototypes
You can't go far in JavaScript without learning how to handle objects.They are the basis for almost every aspect of the JavaScript programming language.In fact, learning how to create objects may be the first thing you start learning.
The object is a key/value pair.The most common way to create an object is to use curly brackets {} and add attr ...
Posted by ironside82 on Thu, 16 May 2019 05:13:21 +0200