İçeriğe geç

Js Veri Tipleri (Data Types)

JavaScript’de Toplam 8 adet veri tipi vardir. Bunlarin 7 adedi primitive (ilkel) dedigimiz veri tiplerinden olusur.

Primitives Veri Tipleri

  1. Boolean. true and false.
  2. null. A special keyword denoting a null value. (Because JavaScript is case-sensitive, null is not the same as Null, NULL, or any other variant.)
  3. undefined. A top-level property whose value is not defined.
  4. Number. An integer or floating point number. For example: 42 or 3.14159.
  5. BigInt. An integer with arbitrary precision. For example: 9007199254740992n.
  6. String. A sequence of characters that represent a text value. For example: “Howdy”.
  7. Symbol. A data type whose instances are unique and immutable.

ve gelismis veri tipi olarak:

  1. Object

** Object veri tipleri sunlari icerebilir;**

  1. An object
  2. An array
  3. A date

Ornek;

// Numbers:
let length = 16;
let weight = 7.5;
// Strings:
let color = "Yellow";
let lastName = "Johnson";
// Booleans
let x = true;
let y = false;
// Object:
const person = {firstName:"John", lastName:"Doe"};
// Array object:
const cars = ["Saab", "Volvo", "BMW"];
// Date object:
const date = new Date("2022-03-25");

Linkler

VIDEO : Veri tipleri

https://www.w3schools.com/js/js_datatypes.asp

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#data_structures_and_types