f



What do I do to be able to fully understand and then at some point write code like the following URL?

Other than advanced JavaScript books, that is, free resources...
https://github.com/k9/globe-viewer/blob/master/app/js/controller.js

Thanks.
0
justaguy
10/14/2016 1:49:38 AM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

12 Replies
428 Views

Similar Articles

[PageSpeed] 23

I wouldn't say that code was necessarily "advanced", however it is 
quite contemporary.
I'd suggest you check out this ES6 tutorial to get your head around 
classes and let variables: http://ccoenraets.github.io/es6-tutorial/

On 2016-10-14 01:49:38 +0000, justaguy said:

> Other than advanced JavaScript books, that is, free resources...
> https://github.com/k9/globe-viewer/blob/master/app/js/controller.js
> 
> Thanks.


0
sail0r
10/14/2016 2:59:37 AM
On Thursday, October 13, 2016 at 11:05:11 PM UTC-4, sail0r wrote:
> I wouldn't say that code was necessarily "advanced", however it is 
> quite contemporary.
> I'd suggest you check out this ES6 tutorial to get your head around 
> classes and let variables: http://ccoenraets.github.io/es6-tutorial/
> 
> On 2016-10-14 01:49:38 +0000, justaguy said:
> 
> > Other than advanced JavaScript books, that is, free resources...
> > https://github.com/k9/globe-viewer/blob/master/app/js/controller.js
> > 
> > Thanks.

Thanks for the pointer.  "let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct?

Also, with code like 
let myfunc = () => whatever { ... }
is it similar to
 myfunct = function() { ... }
Is so, the second option is clearer, why do we need to use the first one?
 
0
justaguy
10/14/2016 10:27:59 PM
On Friday, October 14, 2016 at 6:28:54 PM UTC-4, justaguy wrote:
> On Thursday, October 13, 2016 at 11:05:11 PM UTC-4, sail0r wrote:
> > I wouldn't say that code was necessarily "advanced", however it is 
> > quite contemporary.
> > I'd suggest you check out this ES6 tutorial to get your head around 
> > classes and let variables: http://ccoenraets.github.io/es6-tutorial/
> > 
> > On 2016-10-14 01:49:38 +0000, justaguy said:
> > 
> > > Other than advanced JavaScript books, that is, free resources...
> > > https://github.com/k9/globe-viewer/blob/master/app/js/controller.js
> > > 
> > > Thanks.
> 
> Thanks for the pointer.  "let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct?
> 
> Also, with code like 
> let myfunc = () => whatever { ... }
> is it similar to
>  myfunct = function() { ... }
> Is so, the second option is clearer, why do we need to use the first one?

Correction:
 myfunct = function() { ... } 
->
var myfunct = function() { ... } 
0
justaguy
10/14/2016 10:30:00 PM
>"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:

const SIZE = 165;

const log = x => console.log(x);

>Also, with code like 
let myfunc = () => whatever { ... } 
is it similar to 
var myfunct = function() { ... } 
Is so, the second option is clearer, why do we need to use the first one? 

The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g

let a2 = a.map(function(s){ return s.name })

with

let a2 = a.map( s => s.name )

Which one is clearer?
0
Ram
10/15/2016 7:06:03 PM
On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> >"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
> Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:
> 
> const SIZE = 165;
> 
> const log = x => console.log(x);
> 
> >Also, with code like 
> let myfunc = () => whatever { ... } 
> is it similar to 
> var myfunct = function() { ... } 
> Is so, the second option is clearer, why do we need to use the first one? 
> 
> The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g
> 
> let a2 = a.map(function(s){ return s.name })
> 
> with
> 
> let a2 = a.map( s => s.name )
> 
> Which one is clearer?

I see.  Thanks.

Regarding es6 support, probably the most cutting edge web browser such as Google Chrome supports it?  Is it correct?
0
justaguy
10/15/2016 10:20:28 PM
On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> > >"let" seems to be a better choice for a variable for a block of code w=
ithout concern of unintended affect vs. "var" seems to have global and loca=
l scope.  It seems safer to use "let".  Is such understanding correct?=20
> > Yes, it is. If you have es6 support, "let" is the norm, rather than "va=
r". Es6 also provides the "const" keyword for constants:
> >=20
> > const SIZE =3D 165;
> >=20
> > const log =3D x =3D> console.log(x);
> >=20
> > >Also, with code like=20
> > let myfunc =3D () =3D> whatever { ... }=20
> > is it similar to=20
> > var myfunct =3D function() { ... }=20
> > Is so, the second option is clearer, why do we need to use the first on=
e?=20
> >=20
> > The "arrow function" syntax is not necessary, but in some cases it is m=
ore convenient, less cumbersome, more readable. Compare e.g
> >=20
> > let a2 =3D a.map(function(s){ return s.name })
> >=20
> > with
> >=20
> > let a2 =3D a.map( s =3D> s.name )
> >=20
> > Which one is clearer?
>=20
> I see.  Thanks.
>=20
> Regarding es6 support, probably the most cutting edge web browser such as=
 Google Chrome supports it?  Is it correct?

Even a browser like Chrome does not completely support es6 yet. So, it depe=
nds which es6 features you actually use.=20

Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/), fo=
r example, are not supported by any browser, yet. That's why it is common t=
oday for javascript developers to use a "transpiler" tool, such as Babel (h=
ttp://babeljs.io/) to automatically convert es6 code to es5 code, before go=
ing to production.
0
Ram
10/16/2016 9:31:39 AM
On Sunday, October 16, 2016 at 5:31:46 AM UTC-4, Ram Tobolski wrote:
> On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> > On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> > > >"let" seems to be a better choice for a variable for a block of code=
 without concern of unintended affect vs. "var" seems to have global and lo=
cal scope.  It seems safer to use "let".  Is such understanding correct?=20
> > > Yes, it is. If you have es6 support, "let" is the norm, rather than "=
var". Es6 also provides the "const" keyword for constants:
> > >=20
> > > const SIZE =3D 165;
> > >=20
> > > const log =3D x =3D> console.log(x);
> > >=20
> > > >Also, with code like=20
> > > let myfunc =3D () =3D> whatever { ... }=20
> > > is it similar to=20
> > > var myfunct =3D function() { ... }=20
> > > Is so, the second option is clearer, why do we need to use the first =
one?=20
> > >=20
> > > The "arrow function" syntax is not necessary, but in some cases it is=
 more convenient, less cumbersome, more readable. Compare e.g
> > >=20
> > > let a2 =3D a.map(function(s){ return s.name })
> > >=20
> > > with
> > >=20
> > > let a2 =3D a.map( s =3D> s.name )
> > >=20
> > > Which one is clearer?
> >=20
> > I see.  Thanks.
> >=20
> > Regarding es6 support, probably the most cutting edge web browser such =
as Google Chrome supports it?  Is it correct?
>=20
> Even a browser like Chrome does not completely support es6 yet. So, it de=
pends which es6 features you actually use.=20
>=20
> Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/), =
for example, are not supported by any browser, yet. That's why it is common=
 today for javascript developers to use a "transpiler" tool, such as Babel =
(http://babeljs.io/) to automatically convert es6 code to es5 code, before =
going to production.

Ok, good to know.  So, in this sense, learning es6 is sort of preparing for=
 the future as a developer, and then, it begs for the question, what type o=
f capability/key features in es6 that is/are way superior to es5?

Thanks.
0
justaguy
10/16/2016 8:36:12 PM
On Sunday, October 16, 2016 at 11:36:18 PM UTC+3, justaguy wrote:
> On Sunday, October 16, 2016 at 5:31:46 AM UTC-4, Ram Tobolski wrote:
> > On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> > > On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote=
:
> > > > >"let" seems to be a better choice for a variable for a block of co=
de without concern of unintended affect vs. "var" seems to have global and =
local scope.  It seems safer to use "let".  Is such understanding correct?=
=20
> > > > Yes, it is. If you have es6 support, "let" is the norm, rather than=
 "var". Es6 also provides the "const" keyword for constants:
> > > >=20
> > > > const SIZE =3D 165;
> > > >=20
> > > > const log =3D x =3D> console.log(x);
> > > >=20
> > > > >Also, with code like=20
> > > > let myfunc =3D () =3D> whatever { ... }=20
> > > > is it similar to=20
> > > > var myfunct =3D function() { ... }=20
> > > > Is so, the second option is clearer, why do we need to use the firs=
t one?=20
> > > >=20
> > > > The "arrow function" syntax is not necessary, but in some cases it =
is more convenient, less cumbersome, more readable. Compare e.g
> > > >=20
> > > > let a2 =3D a.map(function(s){ return s.name })
> > > >=20
> > > > with
> > > >=20
> > > > let a2 =3D a.map( s =3D> s.name )
> > > >=20
> > > > Which one is clearer?
> > >=20
> > > I see.  Thanks.
> > >=20
> > > Regarding es6 support, probably the most cutting edge web browser suc=
h as Google Chrome supports it?  Is it correct?
> >=20
> > Even a browser like Chrome does not completely support es6 yet. So, it =
depends which es6 features you actually use.=20
> >=20
> > Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/)=
, for example, are not supported by any browser, yet. That's why it is comm=
on today for javascript developers to use a "transpiler" tool, such as Babe=
l (http://babeljs.io/) to automatically convert es6 code to es5 code, befor=
e going to production.
>=20
> Ok, good to know.  So, in this sense, learning es6 is sort of preparing f=
or the future as a developer, and then, it begs for the question, what type=
 of capability/key features in es6 that is/are way superior to es5?
>=20
> Thanks.

Not exactly, es6 is already the present of javascript. That's why, as I sai=
d, js developers today are willing to use "transpilers", to compensate for =
the lack of complete es6 support in the browsers.

Offhand, in es6 there are:
a. small but important improvements, such as "let", "const", arrow function=
s, and classes.
b. substantial and useful additions, such as promises and modules.
c. more advanced stuff, that is rarely used in everyday js, such as iterato=
rs, generators, proxies.
0
Ram
10/17/2016 10:09:27 AM
On Monday, October 17, 2016 at 6:09:35 AM UTC-4, Ram Tobolski wrote:
> On Sunday, October 16, 2016 at 11:36:18 PM UTC+3, justaguy wrote:
> > On Sunday, October 16, 2016 at 5:31:46 AM UTC-4, Ram Tobolski wrote:
> > > On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> > > > On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wro=
te:
> > > > > >"let" seems to be a better choice for a variable for a block of =
code without concern of unintended affect vs. "var" seems to have global an=
d local scope.  It seems safer to use "let".  Is such understanding correct=
?=20
> > > > > Yes, it is. If you have es6 support, "let" is the norm, rather th=
an "var". Es6 also provides the "const" keyword for constants:
> > > > >=20
> > > > > const SIZE =3D 165;
> > > > >=20
> > > > > const log =3D x =3D> console.log(x);
> > > > >=20
> > > > > >Also, with code like=20
> > > > > let myfunc =3D () =3D> whatever { ... }=20
> > > > > is it similar to=20
> > > > > var myfunct =3D function() { ... }=20
> > > > > Is so, the second option is clearer, why do we need to use the fi=
rst one?=20
> > > > >=20
> > > > > The "arrow function" syntax is not necessary, but in some cases i=
t is more convenient, less cumbersome, more readable. Compare e.g
> > > > >=20
> > > > > let a2 =3D a.map(function(s){ return s.name })
> > > > >=20
> > > > > with
> > > > >=20
> > > > > let a2 =3D a.map( s =3D> s.name )
> > > > >=20
> > > > > Which one is clearer?
> > > >=20
> > > > I see.  Thanks.
> > > >=20
> > > > Regarding es6 support, probably the most cutting edge web browser s=
uch as Google Chrome supports it?  Is it correct?
> > >=20
> > > Even a browser like Chrome does not completely support es6 yet. So, i=
t depends which es6 features you actually use.=20
> > >=20
> > > Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules=
/), for example, are not supported by any browser, yet. That's why it is co=
mmon today for javascript developers to use a "transpiler" tool, such as Ba=
bel (http://babeljs.io/) to automatically convert es6 code to es5 code, bef=
ore going to production.
> >=20
> > Ok, good to know.  So, in this sense, learning es6 is sort of preparing=
 for the future as a developer, and then, it begs for the question, what ty=
pe of capability/key features in es6 that is/are way superior to es5?
> >=20
> > Thanks.
>=20
> Not exactly, es6 is already the present of javascript. That's why, as I s=
aid, js developers today are willing to use "transpilers", to compensate fo=
r the lack of complete es6 support in the browsers.
>=20
> Offhand, in es6 there are:
> a. small but important improvements, such as "let", "const", arrow functi=
ons, and classes.
> b. substantial and useful additions, such as promises and modules.
> c. more advanced stuff, that is rarely used in everyday js, such as itera=
tors, generators, proxies.

Ok, thank you.

Now, a new related question, in the world of MVC, I heard ReactJS is partic=
ularly useful for View, if one intend to further his skills in client side =
technologies, would time spent to learn ReactJS likely yield better return =
than time spent to beef up general JavaScript?  One reason, recruiters/comp=
anies are asking, do you know ReactJS (no recruiter ever ask are you strong=
 in JavaScript)?

Personally, I like jQuery a lot, and would love to pick up more of it.

0
justaguy
10/17/2016 9:33:39 PM
>Now, a new related question, in the world of MVC, I heard ReactJS is parti=
cularly useful for View, if one intend to further his skills in client side=
 technologies, would time spent to learn ReactJS likely yield better return=
 than time spent to beef up general JavaScript?  One reason, recruiters/com=
panies are asking, do you know ReactJS (no recruiter ever ask are you stron=
g in JavaScript)?

From my experience, recruiters ask for MVC framework knowledge in the job s=
pecifications, but in interviews they test you more often on pure javascrip=
t. So, it is best to study some of both.. Also, note that frameworks like R=
eactJS come and go relatively quickly, but pure javascript is more enduring=
.. Typically, the recruiter is less interested in your amount of knowledge o=
f, say ReactJS, or AngularJS, then to see that you understand the basic ide=
as and capabilities of a modern js MVC framework. If you begin to master on=
e framework, you will be able to learn other frameworks, which you will pro=
bably have to do sooner or later.

>Personally, I like jQuery a lot, and would love to pick up more of it.

If you like it, by all means learn more of it. Still, jQuery is much less c=
entral today than it used to be. That is because jQuery's main strength is =
DOM manipulation, but today the MVC frameworks do most of the DOM manipulat=
ion for you automatically.

0
Ram
10/18/2016 6:17:39 PM
On Tuesday, October 18, 2016 at 2:17:48 PM UTC-4, Ram Tobolski wrote:
> >Now, a new related question, in the world of MVC, I heard ReactJS is par=
ticularly useful for View, if one intend to further his skills in client si=
de technologies, would time spent to learn ReactJS likely yield better retu=
rn than time spent to beef up general JavaScript?  One reason, recruiters/c=
ompanies are asking, do you know ReactJS (no recruiter ever ask are you str=
ong in JavaScript)?
>=20

> From my experience, recruiters ask for MVC framework knowledge in the job=
 specifications, but in interviews they test you more often on pure javascr=
ipt. So, it is best to study some of both.. Also, note that frameworks like=
 ReactJS come and go relatively quickly, but pure javascript is more enduri=
ng. Typically, the recruiter is less interested in your amount of knowledge=
 of, say ReactJS, or AngularJS, then to see that you understand the basic i=
deas and capabilities of a modern js MVC framework. If you begin to master =
one framework, you will be able to learn other frameworks, which you will p=
robably have to do sooner or later.
>=20

Good points.  Particularly, "pure javascript is more enduring", exactly my =
sense as well.  It's more fundamental for web client side technology.

> >Personally, I like jQuery a lot, and would love to pick up more of it.
>=20
> If you like it, by all means learn more of it. Still, jQuery is much less=
 central today than it used to be. That is because jQuery's main strength i=
s DOM manipulation, but today the MVC frameworks do most of the DOM manipul=
ation for you automatically.

I mostly like jQuery UI for instance, dialogue, datepicker, accordion.

Btw, I took a look at AngularJS about two months ago, its two way data bind=
ing seems powerful, however, it's extremely restrictive, every iota of code=
 must follow its syntax.  If we say, pure JavaScript is standard English, E=
nglish spoken by Virginians are jQuery, then, AnguarJS is like Spanish, tot=
ally another language.  Such restriction makes uncomfortable.

Yesterday I started to look at reactJS, some argues that it's View only for=
 the MVC framework and its syntax seems convoluted, maybe because I'm new t=
o it. =20

On the contrary, I read a piece about nodeJS, super fast web server because=
 of its way of handing UA requests... sounds like promising, but too bad, I=
 can't play with it because my own computer (laptop) is not accessible at t=
his point.

Thanks.






0
justaguy
10/18/2016 11:55:52 PM
You're welcome
0
Ram
10/19/2016 5:11:57 PM
Reply: