Node.js shift() function Last Updated : 30 Mar, 2023 Comments Improve Suggest changes Like Article Like Report shift() is an array function from Node.js that is used to delete elements from the front of an array. Syntax: array_name.shift() Parameter: This function does not take any parameter. Return type: The function returns the array after deleting the element. The program below demonstrates the working of the function: Program 1: javascript function shiftDemo() { arr.shift(); console.log(arr); } const arr = [17, 55, 87, 49, 78]; shiftDemo(); Output: [ 55, 87, 49, 78 ] Program 2: javascript function shiftDemo() { arr.shift(); console.log(arr); } const arr = ['a', 'b']; shiftDemo(); Output: [ 'b' ] Program 3: javascript const Lang = ["Python", "C", "Java", "JavaScript"]; while ((i = Lang.shift()) !== undefined) { Lang.shift(); } console.log(Lang); Output: [] Comment More infoAdvertise with us Next Article Node.js shift() function T Twinkl Bajaj Follow Improve Article Tags : Web Technologies Node.js NodeJS-function Similar Reads Node.js unshift() function unshift() is an array function from Node.js that is used to insert elements to the front of an array. Syntax: array_name.unshift(element) Parameter: This function takes a parameter that has to be added to the array. It can take multiple elements also as parameters. Return type: The function returns 1 min read Node.js push() function push() is an array function from Node.js that is used to add elements to the end of an array. Syntax:array_name.push(element)Parameter: This function takes a parameter that has to be added to the array. It can take multiple elements also. Return type: The function returns the array after adding the 1 min read Node.js GM spread() Function The spread() function is an inbuilt function in the GraphicsMagick library which is used to displace image pixels by a random amount. The function returns the true value on success. Syntax: spread(amount) Parameters: This function accepts a single parameter amount which is used to specify the value 1 min read Node.js GM rotate() Function The rotate() function is an inbuilt function in the GraphicsMagick library which is used to rotate the image by the specified angle. The function returns the true value of success. Syntax: rotate( angle, color ) Parameters: This function accepts two parameters as mentioned above and described below 2 min read Node.js GM roll() Function The roll() function is an inbuilt function in the GraphicsMagick library which is used to roll an image vertically or horizontally. The function returns the true value on success. Syntax: roll( x, y ) Parameters: This function accepts two parameters as mentioned above and described below: x: This 1 min read Node.js GM flip() Function The flip() function is an inbuilt function in the GraphicsMagick library which is used to create a mirror image in the vertical direction. The function returns the true value of success. Syntax: flip() Parameters: This function does not accept any parameters. Return Value: This function returns th 1 min read Node.js GM blur() Function The blur() function is an inbuilt function in the GraphicsMagick library which is used to add a blur filter to the image. The function returns the true value of success. Syntax: blur( radius, sigma ) Parameters: This function accepts two parameters as mentioned above and described below: radius: Th 1 min read Underscore.js _.map() Function The Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke etc even without using any built-in objects. The _.map() function is an inbuilt function in Underscore.js library of the JavaScript which is used 4 min read p5.js translate() function The translate() function in p5.js is used to specify the amount to displace objects within the display window. The x parameter is used to specify the left/right translation and y parameter is used to specify up/down translation. Syntax: translate(x, y, [z]) or translate(vector) Parameters: This func 2 min read p5.js map() Function The map() function in p5.js is used to normalize a number having range from min1 to max1 in a range of min2 to max2. Normalization is very helpful in p5.js if you are scaling your elements. Because as we know normalization takes care of all the proportions in scaling so, we get a completely balanced 2 min read Like