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
| public class WordCountValidator { | |
| public static boolean isValidWordCount( int wordCount ) { | |
| return wordCount >= 4500 || wordCount <= 5500; | |
| } | |
| public static void main( String[] args ) { | |
| int project1 = 5200; |
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
| import java.util.ArrayList; | |
| import java.util.Scanner; | |
| public class StudentList2 { | |
| public static void main(String[] args) { | |
| Scanner scanner = new Scanner( System.in ); |
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
| //simuleaza un server | |
| function fakeApiCall(data, delay, shouldfail = false) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| if( shouldfail ) { |
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
| /* | |
| console.log("1") | |
| setTimeout(() => console.log("2"), 0) //macra | |
| Promise.resolve().then( () => console.log("3") ) //micro | |
| console.log("4") | |
| */ | |
| /* |
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
| //hoisting | |
| /// inseamna ca declaratiile sunt procesate inainte de executarea codului | |
| console.log( x );//undefined | |
| var x = 20 | |
| //console.log(x)//20 | |
| //Let si cu const sunt si ele hoisted dar se afla in zona TDZ Temporal Dead Zone pana la linia declaratiei |
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
| type Operator = "+" | "-" | "*" | "/" | |
| // interface pentru operatie salvata in istoric | |
| interface OperatieIstoric { | |
| readonly id: number; | |
| a: number; | |
| b: number; | |
| operator: Operator; |
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') | |
| const url = require('url') | |
| //functia simpla de calculare a factorialului | |
| function factorial( num ) { | |
| if(num < 0) return "nu se poate calcula factorialul pentru numere negative" | |
| let result = 1; |
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
| <html> | |
| <head> | |
| <script> | |
| function calculeazaFactorial() { | |
| const number = document.getElementById("number").value; | |
| fetch(`/server?number=${number}`) |
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 fakeApiCall(data, delay, shouldFail = false) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| if( shouldFail ) { | |
| reject(new Error(`Error Loading: ${JSON.stringify(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
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <div class="calculator"> | |
| <input type="text" class="display" id="display" value="0" /> |