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
[ | |
{ | |
"common": { | |
"repoName": "clean-code-javascript", | |
"created_at": "Nov 26, 2016", | |
"user": { | |
"username": "ryanmcdermott", | |
"profile_image_url": "https://avatars1.githubusercontent.com/u/5114666?v=4" | |
}, | |
"branch": "master" |
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
[ | |
{ | |
"data": [ | |
{ | |
"id": "1325041236399456257", | |
"created_at": "Nov 7, 2020", | |
"tweet": "Acquire any skill quickly.<br /><br />Currently, I'm reading a book named \"The First 20 Hours\" by .<a href=\"https://twitter.com/joshkaufman\">@joshkaufman</a> <br />Just finished a chapter on \"Ten Principles of Rapid Skill Acquisition\"<br /><br />How can we review and apply those principles to learn to code?<br /><br />A thread <img class=\"emoji\" draggable=\"false\" alt=\"👇\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f447.svg\"/> ", | |
"customMedia": { | |
"photo": [ | |
{ |
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 chalk = require('chalk') | |
console.log(chalk.red("Hello World")) |
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
fs.readFile('./file.txt','utf-8',(err,data)=>{ | |
if (err) throw err | |
console.log(data); | |
}) |
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
Hello World! |
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') | |
fs.readFile('./file.txt','utf-8',(err,data)=>{ | |
if (err) throw err | |
console.log(data); | |
}) |
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
// - - Main file[main.js] - - | |
const add = require('./calculate') | |
const result = new add(2,5) | |
console.log(result.result()); //Output : 7 |
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
// - - Exported file [calculate.js] - - | |
const Add = class{ | |
constructor(a,b){ | |
this.a = a; | |
this.b = b; | |
} | |
result(){ | |
return this.a + this.b | |
} |
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
// - - Main file[main.js] - - | |
const add = require('./calculate') | |
const result = add.result(2,1) | |
console.log(result); //Output : 3 |
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
// - - Exported file [calculate.js] - - | |
function Add (){ | |
this.result = (a,b)=>{ | |
return a + b | |
} | |
} | |
module.exports = new Add() |
NewerOlder