how to send authorization in header of HTTP GET using ajax


var username="username_here";
var password="password_here";
$.ajax({
type: "GET",
url: "myapi.php",
dataType: 'json',
headers: {
"Authorization": "Basic " + btoa(username + ":" + password)
},
success: function (result){
console.log(result)
}
});

AJAX Authorization

www.codegrepper.com
www.stackoverflow.com

how to remove first element of array in javascript


let numbers = ["I'm Not A Number!", 1, 2, 3];
numbers.shift();

var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];

var arr = [1, 2, 3, 4];
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]

var fruits = ["Banana", "Orange", "Apple", "Mango"]
fruits.shift()

var fruits = ["Banana", "Orange", "Apple", "Mango"];

console.log(fruits.shift()); // prints "Banana"
console.log(fruits) // prints ["Orange", "Apple", "Mango"]

var cats = ['Bob', 'Willy', 'Mini'];
cats.pop(); // ['Bob', 'Willy']

www.codegrepper.com
www.stackoverflow.com

how to remove first element of array javascript


let arrayCheck = ["Apple", "Grapes", "102", "CodeBreaker"]
arrayCheck.shift()

var fruits = ["Banana", "Orange", "Apple", "Mango"];

console.log(fruits.shift()); // prints "Banana"
console.log(fruits) // prints ["Orange", "Apple", "Mango"]

var arr = [1, 2, 3, 4];
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]

var fruits = ["Banana", "Orange", "Apple", "Mango"]
fruits.shift()

www.codegrepper.com
www.stackoverflow.com

how to reduce the size of my electron app


You can reduce the electron app size by packaging using electron-builder package.
PicArt is an electronjs app which I developed recently. It is built using reactJS.
Initially when I packaged the app using electron-packager the Window's build size was
around 98 MB.
Then I found this awesome boilerplate electron-react where they configured the
electron-builder to produced optimised build size.
After using those configuration setup, PicArt's build is now around 36 MB.

www.codegrepper.com
www.stackoverflow.com