Skip to content

Commit 1232ada

Browse files
authored
Update js codes.docx
1 parent 44d92c2 commit 1232ada

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎js codes.docx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,24 @@ Regular Expression(Regex):
29852985
A regular expression is a group of characters or symbols which is used to find a specific pattern in a text.
29862986

29872987
Regular expressions are normally case-sensitive so the regular expression The would not match the string the
2988+
=======================================================================================================================================================================
2989+
Multiple functions:
2990+
var arr = [];
2991+
const checkSort =(a)=>{
2992+
if(!arr.includes(a) && Number.isInteger(a)){
2993+
arr.push(a)
2994+
}
2995+
return console.log(arr.sort((a,b)=>a-b));
2996+
}
2997+
checkSort(5);
2998+
checkSort(4);
2999+
checkSort(2);
3000+
checkSort("abc");
3001+
checkSort("44");
3002+
checkSort(-44);
29883003

3004+
//output: [-44,2,4,5]
3005+
==================================================================================================================================================================
29893006

29903007

29913008

0 commit comments

Comments
 (0)