Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 http = require("http"); | |
| const { readJSON } = require('./readFileJSON') | |
| const server = http.createServer((req, res) => { | |
| const pathName = req.url; | |
| readJSON("data.json", "utf-8") | |
| .then(data => { | |
| if(pathName === "/"){ | |
| res.end(data); |
This file contains hidden or 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
| /* eslint-disable */ | |
| module.exports = function (api) { | |
| api.cache(false); | |
| if (process.env.NODE_ENV === "test") { | |
| console.log("env: " + process.env.NODE_ENV); | |
| return { | |
| presets: [ | |
| "@babel/preset-react", | |
| [ | |
| "@babel/preset-env", |
This file contains hidden or 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 tabManager = ( function () { | |
| const _tabElements = [] | |
| function _detectUrlType(src){ | |
| const urlStructure = {} | |
| if(src.startsWith("http")){ | |
| urlStructure["type"] = "remote" | |
| urlStructure["url"] = src | |
| } | |
| else{ |
This file contains hidden or 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 DataSetTree = [ { "ID": 2, "Phone": "(979) 486-1932", "City": "Chełm", "Name": "Scarlet", "children": [ { "ID": 30, "parentID": 2, "Phone": "(641) 756-7073", "City": "Harrison Hot Springs", "Name": "Hamilton", "children": [ { "ID": 54, "parentID": 30, "Phone": "(800) 876-5942", "City": "Ribnitz-Damgarten", "Name": "Kelsie", "children": [ { "ID": 62, "parentID": 54, "Phone": "(523) 159-2911", "City": "Biała Podlaska", "Name": "Clio", "children": [], "collapse": false, "child": true } ], "collapse": false, "child": true }, { "ID": 87, "parentID": 30, "Phone": "(500) 895-9220", "City": "Piracicaba", "Name": "Maya", "children": [], "collapse": false, "child": true } ], "collapse": false, "child": true }, { "ID": 40, "parentID": 2, "Phone": "(921) 336-7339", "City": "Namur", "Name": "Lionel", "children": [], "collapse": false, "child": true } ], "collapse": false }, { "ID": 3, "Phone": "(573) 685-8350", "City": "Wardha", "Name": "Adria", "children": [ { "ID": 4, "parentID": 3, "Phone": "(630) 292-9737", "Cit |
This file contains hidden or 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
| // You are in charge of the cake for your niece's birthday | |
| // and have decided the cake will have one candle for each year of her total age. | |
| // When she blows out the candles, she’ll only be able to blow out the tallest ones. | |
| // Your task is to find out how many candles she can successfully blow out. | |
| let ar = [3, 2, 1, 3, 2, 2, 2] // each element of array represents to size of candles | |
| function birthdayCakeCandles(ar) { | |
| let max = 0; |
This file contains hidden or 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
| class Rectangle { | |
| constructor(w, h) { | |
| this.w = w; | |
| this.h = h; | |
| } | |
| } | |
| Rectangle.prototype.area = function(){ | |
| return this.w * this.h | |
| } |
This file contains hidden or 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 Person(firstname, lastname) { | |
| this.firstname = firstname || 'Default'; | |
| this.lastname = lastname || 'Default2'; | |
| this.getFullName = function(firstname, lastname) { | |
| return this.firstname + ' ' + this.lastname; | |
| } | |
| } | |
| var jane = new Person('jane'); |
This file contains hidden or 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
| "Comment for Function": { | |
| "prefix": "commentF", | |
| "body": [ | |
| "/** DESCRIPTION ", | |
| "* $1, $4, $7 ", | |
| "* @param {${1:name}} {${2:type}} - [${3:description}]", | |
| "* @param {${4:name}} {${5:type}} - [${6:description}]", | |
| "* @return {${7:name}} {${8:type}} - [${9:description}]", | |
| "*/ " |
This file contains hidden or 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
| // OBJE METODU OLARAK TANIMLAYAMAYIZ | |
| var calculate = { | |
| array: [1, 2, 3], | |
| sum: () => { | |
| console.log(this === window); // => true | |
| return this.array.reduce((result, item) => result + item); | |
| }, | |
| sum2(){ | |
| console.log(this === window); // => false direk objeyi referans alır. |
NewerOlder