Lingquan | Blog

Lingquan | Blog

Truth needs no colour. Beauty, no pencil.

Array Deduplicate in Javascript
Common ways to deduplicate array in JavascriptIt’s common to be asked to delete duplicates in arrays in Interviews.Here is a summary for dedpulication of arrays in Javascript. Method 1: SetIf we can use ES6, we can just simply use Set object to deduplicate. Code sample:123456789var arr = [0,0,,0,...
Understand and Use SSL
1. What is SSL?SSL (Secure Sockets Layer) is a standard security protocol for establishing encrypted links between a web server and a browser in an online communication.The usage of SSL technology ensures that all data transmitted between the web server and browser remains encrypted. 2. What is S...
NPM and Useful Packages
NPM(Node Package Manager)1. What is NPM? NPM could help developer to reuse other peopele’s code by fetching code from NPM registery. 2. Install NPM Since Install Node.js will include NPM, just go to Node.js to install it. Node.js can be viewed as a tool that can make js run outside of browser....
Layout by Flexbox and CSS Grid
Layout by Flexbox and CSS Grid .stress {border: 1px solid black;background-color: #ffedc6; border-radius:5px;padding: 3px;display: inline-block;margin:2px;} Flexbox1. For Container: float, clear, vertical-align for the items inside flexbox will become invalid display: inline-flex vs display: fle...
Differece between rebase and merge in Git
When to merge?We need merge branch with master when we finish new features or modificatin in our own braches.We can use git merge and git rebase. Difference git log will be different: merge will not remain the commits in branch. git operation and effect is different: If we use git merge: ...
Add Search feature By Algolia
Add Search Feature By Algolia in Hexo BlogIt is pretty sample to add feature by using third-party. Algolia is one of them. 1.Sign up Algolia Get an account in Algolia, which can be done by Github account. We can use all features for free in 14 days and we get 100,000 free operations every month...
Ways to improve web performance
Yahoo Ways to improve website performance Minimize HTTP Requests Sites are mainly slow because of too many (or too large) HTTP requests. We can eliminate unnecessary request; combined files: js to a file, css to a file CSS sprites: CSS Sprites are the preferred method for reducing the number of ...
HTML DOM Key Concepts
classlist of dom node1234567function addClass(selector, className){ var elm = document.querySelector(selector); if (elm){ elm.classList.add(className); //elm.classList.remove(className); }} innerHTML, innerText, textContent1<p id="test"> This element ...
Implement a Queue by Javascript
How to Implement a Queue by JavascriptWe got two methods: use array and shift method for dequeue use object and two pointers, see code below12345678910111213141516171819202122232425262728293031class Queue { constructor() { this._storage = {}; this._oldIndex = 0; thi...
Inheritance in Javascript
Inheritance in JavaScriptJavaScript is an object-based language based on prototypes, rather than being class-based.some sentence need to keep in mind Every object has a proto object property (except Object); every function has a prototype object property. Because an object has a single associate...
avatar
Lingquan Han
Keep Learning, Keep Running