Message from JavaScript discussions

August 2018

— Ionic too



use const whenever you want some variables not to be modified

use let if you want the exact opposite of const

use var, if you want to be compatible with ES5 implementations or if you want module/function level scope.

— Would this be correct?

— I would change to use `const` whenever you can and don’t want `references` to be modified.

— You can’t send or receive blobs with GraphQL. I would recommend to send over GraphQL a url where you can consume the media file.
To send binaries to your service you will need a REST API or something like that.

Message permanent page

— OK

— Ionic is meh meh meh

— I use vars only. D.Crockford voted for let only.

— Always use const except when you intend to modify a variable later (which should be avoided as much as possible)

even worst browser like IE 11 supports let and const, there is no need to use var.

Another notable difference between var and let, const is:

var when used in global scope adds properties to window object (in browser) whereas let and const dont add to window object

var a = 1;

will evaluate to 1

where if u use const or let to declare a,

such as
const a = 1

window.a would be undefined

Message permanent page

— For most cases, it's better to transpile to support older browsers.

— Thanks all

— Please who has use mobx for state management??