Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Check if a number starts with another number or not js

let theNumber = 132435;
//1. Convert the number to string
theNumber = theNumber.toString(); // '132435'
//2. Save the result in boolean
let startWithMyNumber = theNumber.startsWith('13'); //true
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Check #number #starts #number #js
ADD COMMENT
Topic
Name
3+6 =