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
variable "instance_name" { | |
description = "Value of the name tag for EC2 Instance" | |
type = string | |
default = "TFExampleApp" | |
} |
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 finalOuput; | |
function multiplyByTwo(inputNumber) { | |
const result = inputNumber * 2; | |
return result; | |
} | |
finalOuput = multiplyByTwo(6); |
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 finalOuput; | |
function multiplyByTwo(inputNumber) { | |
const result = inputNumber * 2; | |
finalOutput = result; | |
return result; | |
} | |
multiplyByTwo(6); |
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 customer = { | |
id: 1, | |
name: 'Steve' | |
}; | |
function updateCustomerName(customer) { | |
customer.name = 'James'; | |
} | |
updateCustomerName(customer); |
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
function prepareBroth() {} | |
function cookNoodle() {} | |
function cookRamen(){ | |
const preparedIngredients = ingredients.map((ingredient) => { | |
if (ingredent.needCut) { | |
// Perform cut | |
} |
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
function prepareIngredients(ingredients) { | |
return ingredients.map((ingredient) => { | |
if (ingredent.needCut) { | |
// Perform cut | |
} | |
if (ingredent.needClean) { | |
// Perform clean | |
} | |
}); |
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 fs = require('fs'); | |
function readCsvFile() { | |
return fs.readFileSync('./random-word.csv', { encoding: 'utf8' }); | |
} | |
function parseFileContent(content) { | |
return content.split(',').map((word) => { | |
return word.trim(); | |
}); |
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 fs = require('fs'); | |
function getFileContents() { | |
const content = fs.readFileSync('./random-word.csv', { encoding: 'utf8' }); | |
const words = content.split(',').map((word) => { | |
return word.trim(); | |
}); | |
return words; | |
} |
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 fs = require('fs'); | |
function readCsv() { | |
const content = fs.readFileSync('./random-word.csv'); | |
console.log('content', content); | |
console.log('Finished reading file'); | |
} | |
console.log('Start reading file'); | |
readCsv(); |
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
// The callback way | |
const fs = require('fs'); | |
function readCsv() { | |
fs.readFile('./random-word.csv', (err, data) => { | |
if (err) { | |
console.error('Error in read csv'); | |
} | |
console.log('content', data); | |
console.log('Finished reading file'); |
NewerOlder