Kevin Powell - CommunityKP-C
Kevin Powell - Community16mo ago
13 replies
snxxwyy

javascript questions

Hey, i have a couple questions about js,

1) what's the logic behind putting conditions in brackets in if statements and loops? e.g.
if (a === b) {
  ...
}

2) when using Number.parseInt, let's say to get the result 10 out of the string "10aaa", why is the radix recommended to be 10 specifically?

3) what are the benefits of using a ternary operator rather than an if statement? and the benefits of using an if statement over a ternary operator?

I'd appreciate any tips. Thanks in advance.
Was this page helpful?