Fabric.js removeFromArray() Method Last Updated : 03 Mar, 2021 Improve Improve Like Article Like Save Share Report The removeFromArray() method is used to remove a value from the specified array of values. Syntax: removeFromArray(array, value) Parameters: This method accepts two parameters as mentioned above and described below: array: This parameter holds the specified array of values. value: This parameter holds the value which is going to be removed from the array. Return Value: This method returns the array of remaining values. Example 1: Javascript <!DOCTYPE html> <html> <head> <script src= "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js"> </script> <script type="text/javascript" src= "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js.map"> </script> <script type="text/javascript" src= "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.js"> </script> </head> <body> <script type="text/javascript"> // Calling removeFromArray() function over // some specified arrays and values to be removed console.log(fabric.util.removeFromArray([1, 2, 3], 2)); console.log(fabric.util.removeFromArray([1, 2, 3], 1)); console.log(fabric.util.removeFromArray([1, 2, 3], 0)); </script> </body> </html> Output: [1,3] [2,3] [1,2,3] Example 2: Javascript <!DOCTYPE html> <html> <head> <script src= "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js"> </script> <script type="text/javascript" src= "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js.map"> </script> <script type="text/javascript" src= "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.js"> </script> </head> <body> <script type="text/javascript"> // Specifying some arrays var array1 = [2, 4, 6]; var array2 = [1, 3, 4]; // Specifying some values var value1 = 2; var value2 = 4; // Calling removeFromArray() function over the // above specified arrays and values to be removed console.log(fabric.util.removeFromArray(array1, value1)); console.log(fabric.util.removeFromArray(array2, value2)); </script> </body> </html> Output: [4,6] [1,3] Like Article Suggest improvement Previous Fabric.js Polygon centeredScaling Property Next Fabric.js line selectable Property Share your thoughts in the comments Add Your Comment Please Login to comment...