This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8 | |
RUN groupadd -r nodejs && useradd -m -r -g -s /bin/bash nodejs nodejs | |
USER nodejs | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8 | |
WORKDIR /home/nodejs/app | |
COPY . . | |
RUN npm install --production | |
CMD [“node”, “index.js”] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj = {}; | |
Object.defineProperty(obj, 'a', { | |
value: 1, | |
enumerable: false | |
}); | |
Object.defineProperty(obj, 'b', { | |
value: 2, | |
enumerable: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj = { | |
a: 1, | |
b: 2, | |
c: 3, | |
d: 9 | |
}; | |
console.log(obj.propertyIsEnumerable('a')); | |
for (let key in obj) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
NewerOlder