button-icon

Login

Login
Archi's Academy
    Courses
    Courses
    #
  • Projects
    Projects
  • Archi's Academy

    Tracks

    #
  • Blogs
    Blogs
  • Pricing
    Pricing
  • Contact
    Contact
  • For Student Clubs
    For Student Clubs

BLACK FRIDAY

85% Discount for all November

whatsapp
Get in touch
Archi's Academy

Navigation

  • Courses
  • Projects
  • Blogs
  • Pricing
  • For Student Clubs
  • Contact Us

Courses

    Tracks

    • Frontend Development
    • Backend Development
    • Quality Assurance
    • Agentic AI Coding & LLMs
    • Mobile Development
    • DevOps

    Legal

    • Privacy Policy
    • Terms of Service

    Contact

    +1 (217) 200 90 93
    Suite No: 8, 400 Emmet Street
    Kissimmee, Florida 34741 USA
    [email protected]

    Copyright © Tech Career Yazılım Danışmanlık A.Ş. 2026

    instagramlinkedingithubyoutubexfacebook
    visamastercardstripeiyzicoamerican-express
    ETBIS
    1. Home›
    2. Blog›
    3. Type conversion in JavaScript

    Software Development

    Coding

    Type conversion in JavaScript

    The three most commonly used primitive data types in Javascript are number, string, and boolean. At one point or another, we may run into situations where we would like to carry out an operation but the available values are of different types.
    For instance, we may prompt a user’s birth year and receive it as a string, but to calculate their age, the input string has to be converted into a number. This is where type conversion comes in.
    Type conversion refers to the manual conversion of a value from one type to another.
    Javascript methods for performing type conversion between strings and numbers are:
    Number() - converts a string to a number
    String() - converts a number to a string
    To convert strings and numbers to Boolean values, Boolean() is used. It results in either true or false. There are 5 values that when converted to boolean become false: 0, an empty string(‘ ‘), undefined, NULL, and NaN. They are referred to as falsy values. Everything else is a truthy value and will become true when converted to a boolean, including an empty object.
    It is worth noting that the methods start with capital letters.
    Archis-frontend-developer-trainee

    Victor Muya

    Tuesday, Jun 29, 2021

    Ready to turn insights into real skills?

    Start building with guided, project-based training and gain hands-on experience from day one.

    TOC

    Table of Content

    No sections found