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 PORT = process.env.PORT || 5000; | |
| const app = http.createServer((req, res) => { | |
| res.writeHead(200, { 'Content-Type': 'text/html' }); | |
| res.write("Hello World"); | |
| res.end(); | |
| }); |
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 fs = require('fs'); | |
| // All the routes are defined here. | |
| const router = [ | |
| { | |
| 'url': '/', | |
| 'fn': (req, res) => { | |
| res.writeHead(200, { 'Content-Type': 'text/html' }); |
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 sym1 = Symbol(); | |
| const sym2 = Symbol(); | |
| sym1 === sym2; | |
| // false | |
| const sym3 = Symbol.for("cat"); | |
| const sym4 = Symbol.for("cat"); | |
| sym3 === sym4; |
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
| let arr = [ | |
| { | |
| firstName: 'Jon', | |
| lastName: 'Doe' | |
| }, | |
| { | |
| firstName: 'example', | |
| lastName: 'example' | |
| }, | |
| { |
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
| let arr1 = [1, 2, 4, 5]; | |
| let arr2 = array1; | |
| arr1 = []; | |
| console.log(arr2); | |
| // -> Output [1, 2, 4, 5]; |
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
| let arr1 = [1, 2, 4, 5]; | |
| let arr2 = arr1; | |
| arr1 = []; | |
| console.log(arr2); | |
| // -> Output [1, 2, 4, 5]; |
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
| let arr1 = [1, 2, 4, 5]; | |
| let arr2 = arr1; | |
| arr1.length = 0; | |
| console.log(arr2); // Output :- [] |
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
| .global _main | |
| .text | |
| parse_num: | |
| mov x1, #0 | |
| 1: | |
| ldrb w2, [x0] | |
| cmp w2, #'0' | |
| blt 2f |
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
| ; ============================================================================== | |
| ; ARCHITECTURE & SYMBOL DEFINITIONS | |
| ; ============================================================================== | |
| .global _main | |
| .extern _printf ; (New: Import standard C printf function) | |
| .align 3 ; Clamp all structures onto high-performance 8-byte boundaries | |
| ; --- TOKEN IDENTIFIERS --- | |
| .equ TOK_NUMBER, 1 | |
| .equ TOK_ADD, 2 |