javascript convert number to string
var myNumber=120;
var myString = myNumber.toString(); //converts number to string "120"
javascript convert number to string
var myNumber=120;
var myString = myNumber.toString(); //converts number to string "120"
js toisostring
new Date().toISOString().slice(0, 16).replace('T', ' ')
// "2020-11-28 00:40"
bytes to string js
const axios = require('axios')
function serializeBytes(sty) {
const string = JSON.stringify({ data: sty })
const input = Array.from(string)
const ouput = input.map((_, i) => string.charCodeAt(i))
return new Uint8Array(ouput)
}
function deserializeBytes(array) {
return new TextDecoder().decode(array)
}
// render 25.000 data no maximum call stack
async function httpRequest() {
const resOne = await axios.get('https://jsonplaceholder.typicode.com/photos')
const resTwo = await axios.get('https://jsonplaceholder.typicode.com/photos')
const resThree = await axios.get('https://jsonplaceholder.typicode.com/photos')
const resFour = await axios.get('https://jsonplaceholder.typicode.com/photos')
const resFive = await axios.get('https://jsonplaceholder.typicode.com/photos')
const data = await Promise.all([resOne.data, resTwo.data, resThree.data, resFour.data, resFive.data])
const encoded = serializeBytes(JSON.stringify({ data: data }))
const decoded = deserializeBytes(encoded)
const parse = JSON.parse(decoded)
console.log(parse)
}
httpRequest()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us