JSFiddle - React, Tailwind, and code Playground

by karthick6891

JavaScript

Array.prototype.odd = function() {
		return this.filter(function (num) {
    return num % 2 !== 0;
  });
}
let arr=[1,2,1,2];

console.log(arr.odd())