JavaScript ES6 Tutorial #2 - Constants

preview_player
Показать описание
----- COURSE LINKS:

---------------------------------------------------------------------------------------------
You can find more front-end development tutorials on CSS, HTML, JavaScript, jQuery, WordPress & more on the channel homepage...

========== JavaScript for Beginners Playlist ==========

============ CSS for Beginners Playlist =============

============== The Net Ninja =====================

================== Social Links ==================

Рекомендации по теме
Комментарии
Автор

Point to be noted here: it is mandatory to assign a value to the 'const' as you declare it.
For example, you cannot just do something like
const pi;
That would throw an error too.
The error reads "Uncaught SyntaxError: Missing initializer in const declaration"
Peace.

mayankgangwal
Автор

Watching you coding is now my new pleasure :))

nganannnguyen
Автор

Amazing that you do this! Keep up the good work :) Stay Motivated <3

iFrancisDC
Автор

You should mention here that if you declare an array with const, you can change it by pushing values to that array. like so:
const myArray = ['Alex', 'Car'];
myArray.push('Bike');

In that case the result will be: ['Alex', 'Car', 'Bike']

PaintInAcoustic
Автор

Very nice and easy, always appreciate good easy to understand tutorials. Thanks!

AJonesB
Автор

Hi Ninja,
I like your lessons. But its really difficult to see the code you are writing it very small on my laptop plus looks slightly blur. Please zoom in on your code.

westwayclimbingcoach
Автор

can you help me because whenever i open brackets and try to launch the index.html it says open an html file or make sure there is and index.html file in your project. thanks
:/

MinerJeffry
Автор

let test = 1; // or const test = 1
function welcome() {
console.log(test); // it should print 1, but not printing.
let test = 2; // or const test =2
}
welcome();

sumitmobiotics
Автор

incredibly you explain, but plissss PI=3.141 // 3.1415

Mike-edbz
Автор

Thank you for your tutorials!


I have some problem, the browser can't execute my code right.
When I type: console.log("The area is: " + pi + r + r);
I receive: The area is: 3.14255

But, when I type without string in the console, everithing is going well:
console.log(pi + r + r);
I receive: 13.142

The browser I use is Chrome Canary. I repeated every step you showed me.


the code:

window.onload = function() {
const pi = 3.142;

function calcArea(r) {
console.log("The area is: " + pi + r + r); // the problem is here, it gives 'pi' as output
}

calcArea(5);

}

Please help

olegobiukh
Автор

Hello.
Can I finish this tutorial by using Atom text editor?

onepercentdaily
Автор

Hey man can you please cut the woaaahhhh thing from your intro it really weird to listen!

mashrurulhaque
Автор

what the hell will do after learning all these? all the tutorials across youtube preaches function loop data type bla bla bla not a single channel practice by making something out of it.

yahiasiddique