O GoConqr está de visual novo! Conte para nós o que você achou.

Notas

Javascript Types - created from Mind Map

ashish palsingh Coding Inglês 1 página

Conteúdo das notas (1)

Página 1

var a;

typeof a; // "undefined"

a = "hello world";

typeof a; // "string"

a = 42;

typeof a; // "number"

a = true;

typeof a; // "boolean"

a = null;

typeof a; // "object" -- weird, bug

a = undefined;

typeof a; // "undefined"

a = { b: "c" };

typeof a; // "object"

typeof null is an interesting case, because it errantly returns "object", when you'd expect it to return "null".

Also, note a = undefined. We're explicitly setting a to the undefined value, but that is behaviorally no different

from a variable that has no value set yet, like with the var a

The [ ] notation requires either a variable (explained next) or a string literal (which needs to be wrapped in " .. " or ' .. ').

You theoretically could use an array as a normal object with your own named properties, or you could use an object but

only give it numeric properties (0, 1, etc.) similar to an array. However, this would generally be considered improper

usage of the respective types.

arrays and function are two of subtype of object types

function foo() {

return 42;

}

foo.bar = "hello world";

typeof foo; // "function"

typeof foo(); // "number"

typeof foo.bar; // "string"

Again, functions are a subtype of objects -- typeof returns "function", which implies that a function is a main type -- and can thus

have properties, but you typically will only use function object properties (like foo.bar) in limited cases.

Informações

Descrição
Coding Notas sobre Javascript Types - created from Mind Map, criado por ashish palsingh em 27-03-2019.
Criado por
ashish palsingh
Visualizações
1
Histórico
  • Criado por ashish palsingh · 27 mar 2019
  • Copiado para Nota por ashish palsingh · 27 mar 2019
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?