Ali Nouman
This is a site slogan
  • Twitter
  • Linkedin
  • Home
  • About Me
  • Blog
  • Portfolio
  • Contact Me
  • Home

How to remove a particular element from an array in JavaScript?

08 Oct

How to remove a particular element from an array in JavaScript?

By alinouman javascript, es6, tips, arrays 0 Comments
You can easily remove a particular value from an array in Javascript using following code:
let value = 3;

let arr = [1, 2, 3, 4, 5, 3];

arr = arr.filter(item => item !== value);

console.log(arr); 
// [ 1, 2, 4, 5 ]

Share this post

Author

alinouman's picture

alinouman

Categories

  • .htaccess
  • ajax
  • angular
  • arrays
  • babel
  • Popular
  • Recent
  • Safely get a nested value inside an object
    Oct 08, 2016
  • Writing Custom Callback for ajax
    Feb 15, 2017
  • Visual Studio 2015 Enterprise Full |Serial keys
    Oct 11, 2016
  • Writing Custom Callback for ajax
    Feb 15, 2017
  • Anonymous function assigned to variable vs a named function.
    Feb 04, 2017
  • Check if object value exists and set new value for object key | Code optimization
    Feb 01, 2017
Get In Touch

Newsletter

Keep up on our always evolving product features and technology. Enter your e-mail and subscribe to our newsletter.

Contact Me

  • Skype: ali.nouman92

  • Email: [email protected]

Follow Me

  • Twitter
  • Linkedin

© Copyright 2020 by Ali Nouman

  • Contact