button-icon

Entrar

Entrar
Archi's Academy
    Cursos
    Cursos
    #
  • Projetos
    Projetos
  • Archi's Academy

    Trilhas

    #
  • Blog
    Blog
  • Precos
    Precos
  • Contato
    Contato
  • Para clubes universitarios
    Para clubes universitarios

BLACK FRIDAY

85% de desconto durante todo novembro

whatsapp
Entre em contato
Archi's Academy

Navegacao

  • Cursos
  • Projetos
  • Blog
  • Precos
  • Para clubes universitarios
  • Contato

Cursos

    Trilhas

    • Desenvolvimento Frontend
    • Desenvolvimento Backend
    • Garantia de Qualidade (QA)
    • Programacao com IA Agente e LLMs
    • Desenvolvimento Mobile
    • DevOps

    Legal

    • Politica de Privacidade
    • Termos de Servico

    Contato

    +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

    Salı, Haz 29, 2021

    Pronto para transformar conhecimento em habilidades reais?

    Comece a construir com formacao guiada por projetos e ganhe experiencia pratica desde o primeiro dia.

    TOC

    Table of Content

    No sections found