Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:31:28+00:00 2026-05-28T00:31:28+00:00

I’ve read a lot about Data Types in javascript, but found nothing about long

  • 0

I’ve read a lot about Data Types in javascript, but found nothing about long int.
I need to know how to define Long Int in javascript.
The reason is the input of following methods of Range object accepts Long data type as second parameter :

    var storedSelection = document.createRange();
    storedSelection.setStart(document.body,  );
    storedSelection.setEnd(document.body,  );

This Image is captured from WebStorm IDE, please pay attention to type mentioned in this image:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:31:29+00:00Added an answer on May 28, 2026 at 12:31 am

    If you’ve read a lot about JavaScript’s data types as you say then you should already know that:

    1. JS variables are loosely typed. That is, when you declare a variable you don’t give it a type (only assigned values have a type).
    2. Any given variable can be assigned values of different types at different times. That is, having set x = 12 you can later set x = "some string" or x = { some : "object" } and so forth.
    3. JS only has one number type, floating point numbers (IEEE-754 doubles), so generally speaking no distinction is made between integers and decimals.

    I don’t know where you read that the range methods accept a “long int data type” as a parameter, but for that parameter you can pass in a JS variable that you know holds an integer, or a numeric literal, or even a function call that returns a number:

    function getNumber() {
       return 15;
    }
    
    var myVariable = 20;
    
    var storedSelection = document.createRange();
    storedSelection.setStart(document.body, 12);
    storedSelection.setEnd(document.body, myVariable);
    storedSelection.setEnd(document.body, getNumber() );
    

    Further reading: https://developer.mozilla.org/en/JavaScript/Guide/Values,_Variables,_and_Literals

    P.S. If you have a non-integer value as a result of a calculation, say you’re calculating your range by dividing the total length by three or something, you can force the result to be an integer by rounding to the nearest integer with Math.round() or rounding down with Math.floor() or rounding up with Math.ceil(). See also the Math object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I want to construct a data frame in an Rcpp function, but when I
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.