Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get the first number of the integer in js

var number = 132943154134;

// convert number to a string, then extract the first digit
var one = String(number).charAt(0);

// convert the first digit back to an integer
var one_as_number = Number(one); 
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery get all title 
Javascript :: error java.io.filenotfoundexception tessdata/eng.traineddata 
Javascript :: js change url 
Javascript :: jquery set text of h1 
Javascript :: js get mouseclick 
Javascript :: await settimeout 
Javascript :: onEnter input field react 
Javascript :: radio button checked event jquery 
Javascript :: remove decimals javascript 
Javascript :: js get element padding 
Javascript :: load a new page in javascript 
Javascript :: js number to hex 
Javascript :: javascript get origin url 
Javascript :: cors error in react 
Javascript :: set autofocus javascript 
Javascript :: get variable name javascript 
Javascript :: element is hidden jquery 
Javascript :: set delay react native 
Javascript :: react get url querystring 
Javascript :: how to set form control value in angular 
Javascript :: nodejs server fetch is not defined 
Javascript :: parse json express 
Javascript :: webview javascript enabled 
Javascript :: how to add react scroll scrollable link 
Javascript :: how to get iso date with moment 
Javascript :: jquery check input 
Javascript :: jquery slidetoggle 
Javascript :: how to see if a web site is useing react 
Javascript :: firebase database check if value exists 
Javascript :: Ajax Form All Data Send 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =