Archive: 2017/7

Data Structure Study in JS (Array)

Keywords simplest memory DS, same data type, modified objects Creating and Initializing1) use new keyword1var testArray = new Array(); 2) []12var testArray = []; //declarevar testArray2 = ['t

AngularJS(1.x) HTTP post method & PHP

What happened? I was working on my company’s web application (CI3) and so far while I was using jQuery Ajax, I had no problem with CI method of getting POST inputs. I used the following code. 1$date

CURL in PHP

Basicscurl in PHP basically does the same thing as curl in different languages or environments, but php has its own way of using it. It is not too difficult though.Here are basic codes I used when I w

NGINX and PHP Settings

NGINX by itself does not provide PHP support. In order to make it work smoothly with PHP, additional implementation, which is PHP-FPM. When first installed NGINX, begin with installing php and php-fpm

How to use Class in JS (2)

Refence to this page. Credits go to Isaaks, the writer of that article. This is for my personal study. Boxing with Prototype & static methodsBoxing: wrapping primitive non-object with a correspond

How to use Class in JS (1)

(This is my personal practice on this page. May use some similar codes.) Declare a class123456class Page { constructor(words, lines){ this.words = words; this.lines = lines; }&#

Deep Copy in JS

When an object is put into another variable, it is copied by reference. This means if the original object changes, the referenced values will change too. 123456789101112131415var originalArr = [ &#

Clousure in JS

This is a brief explanation for closure in js. Closure is a function that returns a function. Basic Usage:12345678910var saveFn = function (val) { return function () { return val

Short Lesson on 204 Response

Today it happened to me that between REST API and client, response body came back empty even if it was set from REST API server. We spent good 1 hour trying to solve this, and it turned out it was bec

HTTP Basics

HTTP basicsHTTP allows two types of messages to be transferred between client and server. Both HTTP Request and HTTP Response have common format, and contains HTTP Header and HTTP Body. HTTP Header Co