Understand major concepts in docker in 10 minutes

The Neuschwanstein castle, Germany

What is docker?

A tool to managing containers which is a separate environment contains some pieces of code or a software and its dependencies, so it runs independently no matter how its host is and always produce the same result.

Isn’t virtual machine can achieve the same result?

Yes, they can achieve similar result but there are big difference between them


Spiss Castle, Slovakia

In this passage, we will mainly focus on those built-in array functions and several use cases.

Execute the function for each element in array and accumulate them to be the final result

Example 1let numbers = [1, 2, 3, 4, 5];let result = numbers.reduce(sum);//total - the value of last result
//At the beginning, the total is 1 - 1st element in array,
//and num is 2 - 2nd element array
//Then the value of total will be 1 + 2 = 3,
//and num will be 3 - 3rd element array
//Then the value of total…

1. callbacks

First, we have to understand some key concepts in Javascript — synchronous/ asynchronous and blocking/ non-blocking

Consider the following snippets

//simple callbacks exampleconst greetings = () => {
console.log('Hello');
};
const greetingsLater = () => {
console.log('Hi');
}
setTimeout(greetingsLater, 5000);
greetings();

Like most of the programming language, Javascript execute the code from top to bottom, one line after another — Synchronous
In the above code snippet, it creates 2 functions — “greetings” and “greetingsLater”, then execute functions “greetingsLater” by built-in function “setTimeout” and lastly execute greetings

Other built-in aynchronous functions including: setInterval(), requestAnimationFrame(), navigator.geolocation.getcurrentposition …

It will output

Hello
Hi…


This time we would go a little bit deeper about state, including shouldComponentUpdate(), PureComponent and Context API

Before we continue, let’s have a look How ReactJS update our pages

By default, if any changes in props or state…


What is state?

state is the property in your app. When the app is running, it changing the state according the business logic in order to fulfil the user requirement.

If you familiar with Java, state is something like private variable, we can’t edit it outside of the class which created it. They’re invisible to other class unless we explicitly pass to another class (or function component) and they’re called “props” there. Other class can edit the state only if we explicitly pass the function

Before React 16.8, state is only available in class component. …


The algorithm I am going to talk about is specifically around the big(O) notation, and in this passage we are more focus in time complexity

Recently, I took some interviews in developer jobs and algorithm related question is one of the hot topics I have been asked.

I am not good at that and I am not an expert in this field, but I think this is something necessary if you want to pass the job interviews especially in developer position

In this passage, I will try to summarize the basic concepts (I learned from different sites) about the big(O)…


The Library of Trinity College

Mostly we return a resolved promise object with a given value, that value can be everything, it can be another promise or thenable statement, if that value is a thenable statement, then the fulfillment status will be depends on it. For more, please refer to the MDN docs

Promise.resolve("finished").then(data=> {console.log(data)})//output
//finished

Same as Promise.resolve() but return a rejected promise, others are same

_______________________________________________________________

Below are built-in promise functions that handle multi promise

We will re-use the promisfy examples from last post

//Promisfied setTimeout
const delay = (msg, ms) => new Promise(resolve => setTimeout(
() => resolve(msg)…

As in last passage, I will try to list out the difference and explain them in simple English and examples. After reading both passages, you should be able to understand the syntax of Javascript with no more confusion.

1.
Pre-compiled vs Not pre-compiled,
Static type vs Dynamic type,
Strong type vs Weak Type

Java has to compile to bytecode — the .class file, before you can run on the JVM. That means our code would be review by the compiler, and once we decide the type of variable, we couldn’t change it later.

The following Java code snippet would cause…


In Javascript, there are lots of method related with Object and Array, it is not easy for beginners to remember them.

In this session, I am going to introduce you Object.keys() / Array map() / […] (spread operator) and an example related with them. Once you understand that example, I am sure you will understand and remember them.

Object in Javascript
Start and end with curly braces

***Never use arrow function inside Javascript object, for detail, please read ES6 JavaScript — “this” keyword

let car = {type:"Tesla", model:"Modal X", color:"white"};//In Javascript, objects can contains function
let car = {…


If you are a Java developer and you want to learn about modern Javascript, then this page may give you some idea. Some programming concepts/syntax are similar in both languages, some are not. I try to list out the difference below in simple English

In Java, everything is required to contain in Class.
In Javascript, you’re not necessarily contain everything in Class. If you only have a few lines of code, you can just put everything in the global scope. Although in React.JS, …

Johnny Lai

Self-taught programmer locating in New Zealand.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store