#15 JavaScript Arrow Functions | JavaScript for Beginners

preview_player
Показать описание
An arrow function expression is a compact alternative to a traditional function expression, but is limited and can't be used in all situations.

In this video, we will learn about JavaScript arrow functions. Arrow function is one of the features introduced in the ES6 version of JavaScript. It allows you to create functions in a cleaner way compared to regular functions.

Watch the full video to have a clear understanding of the working of JavaScript Arrow Functions.

~

Timestamps:
00:13 JavaScript Arrow Functions
03:00 Arrow function with parameters
04:54 Arrow Function with return statement
06:43 Programming Task
07:46 Quiz

Find Programiz elsewhere:
---------------------------------------------------

#15 JavaScript Arrow Functions | JavaScript for Beginners

#programiz #javascript #JStutorial #function #JS #ArrowFunctions #learnprogramming
Рекомендации по теме
Комментарии
Автор

Great series and channel. Better than my expensive coding bootcamp!

james_whitford
Автор

Awesome tutorial man. Super simple and concise! Looking for something like this.

jacksebbenunicyclist
Автор

1:43 in normal function is easier we just had to use the keyword function..in this we have to use declare and variable and all

vishwankvrai
Автор

my soution:

let no = parseInt(prompt('Enter a number: '));
const isPrime = () => {
if (no<= 1){
console.log('number invalid, please input a number that is less than 1.');
}
for (i = 2; i < no; i++) {
if (no % i == 0) {
return false;
}
}
return true;
}
let p = isPrime(no);
if (p == true){
console.log('prime');
}
else {
console.log('not');
}

AyeAye-kk
Автор

Thank me later 🙂
answer is here..

const prompt =

const number = parseInt(prompt("enter a number to check prime or not= "))

const isPrime = (num)=>{
if(num<2){
return false
}
for(let i=2;i<num;i++){
if(num%i === 0){
return false
}
}
return true
}

const result = isPrime(number);

if(result){
console.log(`${number} is prime number`);
}else{
console.log(`${number} is not prime number`);
}

shanioshaheem
Автор

Answer:
const primeNumber = () =>{
let isPrime = parseInt(prompt("Enter a number:"));
if( isPrime == 2 ){
return(`${isPrime} is a Prime Number.`)
}else if(isPrime <= 1){
return("Enter a Number above 2")
}
for(var i = 2; i < isPrime; two++){
if(isPrime % i === 0){
return(`${isPrime} is not a Prime Number.`)
}else{
return(`${isPrime} is a Prime Number.`)
}
}
return isPrime;
}

primeNumber();

BarathV-feky