How to
Validate a group of conditions
let conditionsArray = [ condition1, condition2, condition3, ]
if (conditionsArray.indexOf(false) === -1) { "do something" }Oliver Steele’s Nested Object Access Pattern
const name = ((user || {}).personalInfo || {}).name;Download files with Axios and Laravel
export const getFile = (coArquivo, config = { responseType: 'blob' }) => instance.get(`/upload/${coArquivo}`, config)
.then((response) => {
const { headers } = response;
const dadosFilename = headers['content-disposition'].split('filename=');
const filename = dadosFilename[1];
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
});Get only decimal from number
Node.js Port 3000 already in use | Kill process
Last updated