Comparación entre lenguajes usando: namespace, static method, instance, callback, enum y types
namespace Core.Utils
{
public static class HttpUtil
{
// helper.js | |
export async function toBase64(blob) { | |
return new Promise((resolve, reject) => { | |
const reader = new FileReader() | |
let fullStr = '' | |
const getPositionSymbol = symbol => { | |
return fullStr.search(symbol) + 1 | |
} |
const nroList = [1, 4, 1, 3, 2, 4]; | |
const collector = []; | |
let qty = 1; | |
nroList.forEach((nro, index) => { | |
qty = 1; | |
if (!collector.find(item => item.nro === nro)) { | |
for (let i = 0; i < nroList.length; i++) { | |
const nroCurrent = nroList[i]; |
const maxLimit = 1; | |
const minLimit = 5; | |
const range = [...Array(maxLimit - minLimit).fill().map((_, i) => minLimit + i), maxLimit]; | |
console.log(range); // out: [1, 2, 3, 4, 5] |
<?php | |
function fibonacci(int $serie): array { | |
$firstNro = 0; | |
$secondNro = 1; | |
$arraySequence = [0]; | |
for ($i=1; $i <= $serie; $i++) { | |
$suma = $firstNro + $secondNro; |
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
lerna-debug.log* | |
# Diagnostic reports (https://nodejs.org/api/report.html) | |
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
var isoCountries = { | |
'AF' : 'Afghanistan', | |
'AX' : 'Aland Islands', | |
'AL' : 'Albania', | |
'DZ' : 'Algeria', | |
'AS' : 'American Samoa', | |
'AD' : 'Andorra', | |
'AO' : 'Angola', | |
'AI' : 'Anguilla', | |
'AQ' : 'Antarctica', |
const numbers: number[] = [0, 1, 2, 3, 4]; | |
// Method 1 -> FOR | |
function method1(): void { | |
for (let index = 0; index < numbers.length; index++) { | |
const nro: number = numbers[index]; | |
console.log(nro); | |
} | |
} |