Introduction to functions in javascript
HTML-код
- Опубликовано: 21 авг 2024
- Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
All the learning resources such as code files, documentations, articles and community discussions are available on our website:
chaicode.com/
You can find our discord link, github link etc on the above website.
Twitter/X link: x.com/hiteshdo...
Discord link: hitesh.ai/discord
Learn React with 10 projects: • Let's learn react from...
Learn Docker: • A practical guide on D...
Learn Kubernetes: • Complete Kubernetes Co...
How does a browser works: • How does a browser wor...
How nodejs works: • How node JS works | En...
Learn Redux-toolkit: • Learn Redux Toolkit in...
Learn NextJS: • Nextjs Full stack course
Learn Typescript: • Why to learn Typescript
Learn Javascript: • Welcome to new JavaScr...
Learn React Native: • React Native Mastery: ...
Learn Zustand: • React state management...
Learn Golang: • How to get started wit...
TYPES OF FUNCTIONS:-
function name ( param ) {} // Normal function
var name = function (){}; //Anonymous function assigned to a variable named "name"
const name = (param) => {}; // es6 arrow function, defined with const named "name"
:)
assignment:
let sayHello = function(name){
console.log(`greeting message for ${name}` )
console.log(`Hey ${name}`)
}
sayHello('Hitesh')
Thank you Hitesh. I am in the precourse stage of a bootcamp and their demos include 'console.log()' only, but the exercises use RETURN, which can cause students to confuse the two as producing the same result. I have watched a half-dozen videos and yours broke it down best. Subscribed.
I know some stuffs of JS but I still following this course with 1.5x playback speed because the way Hitesh sir teach us is amazing! Keep doing this !
Really fun series to learn from. I will have already learnt JS basics before my collage courses start hahaha thanks to you.
Best js series 👍
He is one of the best teacher in the world , I am going to buy his online courses :)
I like the Indian accent. "parenthesis" is paren + thesis. Another word "parameters" is para + meters. In Brazil we have somewhat the same way of saying words, like emphasis in the last part of the word, sometimes in the middle of the word and even in the beginning of the word. Some words sounds like a roller coaster, and it sounds nice.....In English is kind of flat. like "parenthesis" but in parAmeters the upper case A is where the Americans do speak their roller coaster and Hitesh speaks like paraMeters with his roller coaster starting on M.....I love linguistics. Sorry guys, off topic, but really nice......
This is the mOst intersTing comment :)
;) Thanks Hitesh. I LOve India and your milenar cuLture...
really good and informative comment
Loving the Series. Thanks Hitesh.
Best series ever i seen..
How u make mistakes to understand easier it was awesome..
I did my own examples just to make sure I understood it, and they all worked. :-)
Great series!
Hi Hitesh, we very much enjoying this series.
Sir $ is not working what is the problem ,when I execute programme it happen all copy, first-name and last name John and doe are not happening
The answer happening same as ${firt name } ${last name } not John and doe help me
Same here bro....
Did you find any solution??
@@drpstar bro remove doller and use only variable in console.log(given variable)
Very Helpful videos.The way you explain is very clear and interesting.Thanks.
let mymultiply = function(num1,num2){
multiply =num1 * num2
return multiply
}
mymultiply(6,8)
console.log(mymultiply(6,8))
let fullNameMaker = function (firstName, lastName) {
console.log("Welcome to RUclips");
console.log(`Happy to have you ${firstName} ${lastName}`);
};
fullNameMaker("srikanth", "racharla");
let myAdder = function (num1, num2) {
let added = num1 + num2;
return added;
};
console.log(myAdder(7, 7));
Thanks for this one!
very useful for me and easy to understand
yaa...i love all videos by YOU...thankyou
thanks for uploading such a marvelous series on javascript
I wish I had you in my school 😊😊
#great teacher
is it gonna be a complete series of JavaScript ?
let sayHello = function (name) {
console.log("Greeting messgae to " + name);
console.log(`Hey ${name}`);
};
sayHello("Srikanth");
Sir, ${} is not working on my computer...
it is printing as it is value....
yeah, same here
@@yashwanthreddy366 but it is working on chrome console , I am still using
Tip: use inside ` ` it ,not in " " or ' '
@@YoYo-eg6rc Hi I do have the same issue
Yup, It will work for few Browser and not for few as these are related to JS6 latest release, adding multiple variable in message and multi-line message. So expected that It may only work in Chrome else a browser that is upgraded to support JS6
Sir, I loved this series
what is the difference between
Console.log(`hey ${name}`)
and
Console.log("hey" + name)
Both gives same output.
Plz explain
you use the ${} when the value is inside a sentence for instance ..my name is ravi and i m learning JS whereas the +name u calling a defined value at the end of ur sentence for insance ....my name is : ravi you ll not be able to continue the sentence with the name in between
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
here is code for sin(x)
let angle = 3.140/6;
let nr = angle;
let dr = 1;
let i,sinx=angle,t=1,num=0;
for(i=1; i
Thank you for these series.
Awesome series sir
Okay one question, why are you using back ticks in those functions when printing the function parameters?
hii sir, i have question!! What's the difference between general function and arrow function???
let fullName=function(num1,num2)
{
document.write(`sum is,${num1+num2}`)
}
let result=fullName(1,3)
Sir, what if we wanna use the parameters passed inside the function block, how to access those parameters ?
*/* Really professional explanation! ^^
Only he taught us anonymous functions in this video but i hope he will also going to make a video on normal function declaration method like
function function-name()
{
}
very informative
I guess statement : let sayHello = function(name){} doen't mean function's name is sayHello rather funtion is assigned to a variable named sayHello..
Why you not write firstname and lastname in camel case, it is a way to write this or something else please explain it so I just clear this in my mind.
Super JS series
nice video sir
I follow above two conditions for add number also.. and it returns same..
im not getting the output in terminal, instead im getting an error that the syntax is wrong in microsoft script host
hey I need some help.Whenever i Invoke this ${para} it does not call the parameter.Where is the problem?
Use semicolon is a good practise
I am using termux to run js it is not showing any errors of my programme do you have any solution
👌👌👌👌
Sir I got +9 error but I do exactly same as you
sir what if we write var instead of let in this...
How to read a value from the user in nodejs?
yeah one more...great
hitesh how i can take input from user
${} not working for me as well....I am trying to execute in JS bin ...is this problem with JS bin?
use back tick as seperators
i have a query about arrays and something else
When to use ' and when to use " ???
Difference bn Document.write() & console.log() ?
Console.log directly shows the output in console area.
Document.write shows the output in the big screen, where the html outputs are usually shown
Hi, $ is not working for me, when I m trying to pass, it came in the simple string form. Can anybody please help me with it?
Maybe u are using ' ' instead of ` `
whenever i'm executing node functions.js command it is giving me
can't find module error
anyone tell me what to do
check out where you have saved the file >trace the path upto that folder then,run this command to >run this js file
${ } function not working
♥️♥️♥️♥️♥️♥️♥️♥️
what if i write:
let name = 'john'
console.log(`Heyy ${console.log(name)}`)
its output is : Heyy undefine
BUt i don't understand why undefine.. if anyone can help me..
let name = 'john'
console.log(`Heyy ${name}`)
because in console.log(`Heyy ${console.log(name)}`) first console.log(name) will operate which will give john and again console.log(`Hey ${john}`) will operate and john is not defined because ${Here it takes a variable}.
Hope it's clear
Tip: start operating the code from right to left and acknowledge which code will operate first.
Dude i think most of the time that format is used as a placeholder for a variable that has been declared and assigned a value.
@@Mayankyadavmy I understood clearly dude
I'm probably not going to get a fucking response from this like always but why use 'let' instead of 'var' to declare a function??
$ sign function is not working in my system
Use ` ` not single quotes
Thx bro
???
let helloFriend = function(name){
console.log(`Greeting msg for ${name} `)
console.log(`Hello ${name}`)
}
helloFriend("Tarun")
Sorry to say but sound is not good