JSFiddle - React, Tailwind, and code Playground

by Pritesh Patel

JavaScript

function test(){
let a=0;
	for(let i=0; i<=arguments.length; i++){
  	if(arguments[i]==2){
    	console.log("2 is present")

      a++;
     break;
    }
    
  }
  if(a==0){
    	console.log("2 is not present");
    }
}
test(1,2,3);
test(1,3,4)