Write a JavaScript program to filter out the element(s) of a given array, that have one of the specified values

  • برمجة جافاسكربت java script
  • برمجة

Write a JavaScript program to filter out the element(s) of a given array, that have one of the specified values.

الأجوبة

const without = (arr, ...args) => arr.filter(v => !args.includes(v));

console.log(without([2, 1, 2, 3], 1, 2));
console.log(without([2, 1, 2, 3], 3));
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...