Skip to content

Instantly share code, notes, and snippets.

FROM node:8
RUN groupadd -r nodejs && useradd -m -r -g -s /bin/bash nodejs nodejs
USER nodejs
WORKDIR /home/nodejs/app
COPY package.json .
RUN npm install --production
FROM node:8
RUN groupadd -r nodejs && useradd -m -r -g -s /bin/bash nodejs nodejs
USER nodejs
...
FROM node:8
WORKDIR /home/nodejs/app
COPY . .
RUN npm install --production
CMD [“node”, “index.js”]
let obj = {};
Object.defineProperty(obj, 'a', {
value: 1,
enumerable: false
});
Object.defineProperty(obj, 'b', {
value: 2,
enumerable: false
let obj = {
a: 1,
b: 2,
c: 3,
d: 9
};
console.log(obj.propertyIsEnumerable('a'));
for (let key in obj) {
const arr = [2,4,5,6,8,9];
for(let num of arr) {
console.log(num);
}
const str = 'JavaScript';
for(let letter of str) {
console.log(letter);