how to store and delete s3 image using node js


const s3 = new AWS.S3(
{ accessKeyId: IAM_USER_KEY, /* required */# Put your iam user key
secretAccessKey: IAM_USER_SECRET, /* required */ # Put your iam user secret key
Bucket: BUCKET_NAME /* required */ # Put your bucket name
}
);
s3.deleteObject({
Bucket: MY_BUCKET,
Key: 'some/subfolders/nameofthefile1.extension'
},function (err,data){})

www.codegrepper.com
www.stackoverflow.com

how to stop requestanimationframe in javascript


Canceling requestAnimationFrame() #
If you assign your requestAnimationFrame() method to a variable, you can use the cancelAnimationFrame() method to cancel it before it runs. // Setup the animation var animation = window. requestAnimationFrame(function ()

www.codegrepper.com
www.stackoverflow.com

how to sort array least to greatest javascript stACK


function sortArray(array) {
var temp = 0;
for (var i = 0; i < array.length; i++) {
for (var j = i; j < array.length; j++) {
if (array[j] < array[i]) {
temp = array[j];
array[j] = array[i];
array[i] = temp;
}
}
}
return array;
}

console.log(sortArray([3,1,2]));

www.codegrepper.com
www.stackoverflow.com

how to sort array without using sort method in javascript


function bubbleSort(array) {
var done = false;
while (!done) {
done = true;
for (var i = 1; i < array.length; i += 1) {
if (array[i - 1] > array[i]) {
done = false;
var tmp = array[i - 1];
array[i - 1] = array[i];
array[i] = tmp;
}
}
}

return array;
}

var numbers = [12, 10, 15, 11, 14, 13, 16];
bubbleSort(numbers);
console.log(numbers);

www.codegrepper.com
www.stackoverflow.com