2

I have 10 digit telephone number. I need to find the last 4 digits of a given number using Angular Js.

Is there any way to find the given number.

EG: 9916983265

1 Answer 1

3

If your telephone number is a String

var telNb = "9916983265";
var last4Digits = telNb.substring(telNb.length-4, telNb.length);

If your telephone number is an integer :

var telNb = 9916983265;
var last4Digits = telNb % 10000;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.