Here is the answers to all the Homework, I gave you in my 4th video (String & Number Type) 1: Substring: let longText: string = "This is a long sentence."; let shortText: string = longText.substring(0, 10); 2: String Comparison: let str1: string = "Hello"; let str2: string = "World"; let areEqual: boolean = str1 === str2; 3: String Template: let product: string = "Phone"; let price: number = 500; let message: string = `The product ${product} is priced at ${price} dollars.`; Hope you all love the video :)
@web-dev.ashishk
11 ай бұрын
Day-5 assignment : var num: number = 1280; function isDivisibleBy4(a: number): boolean { var last2DigitString = String(a).slice(-2); var last3DigitString = String(a).slice(-3); var last2DigitNumber = Number(last2DigitString); var last3DigitNumber = Number(last3DigitString); // console.log(typeof last2DigitNumber); return last2DigitNumber % 4 === 0 && last3DigitNumber % 8 === 0; } console.log(isDivisibleBy4(num));
@vishalbrow
Жыл бұрын
// TODO : write a typescript function isDivisibleBy4and8 that takes a number as a parameter and returns true if the number is divisible by both 4 and 8. const isDivisibleBy4and8 = (x: number): boolean => { return x % 4 === 0 && x % 8 === 0; } console.log(isDivisibleBy4and8(32));
@thinkpad6209
14 күн бұрын
not && operator try || operator
@jonnysharan4393
8 ай бұрын
if you want to store the value greater than 2 raise to power 58 then use bigint and want to store true or false then use boolean syntax :bigint :boolean for boolean and check for the version greater than es20 and lib also es20 and dom on ts config file created with the help of code tsc init used to add the libraries like bigint or noEmitOnError to true
function Add(a:number):boolean{ return a % 2 === 0; } console.log(Add(4))
@jagdishjena9058
11 ай бұрын
Thank you so much sir.💕💕💕💕💕💕
@AniketMohan
5 ай бұрын
7:17 homework function isDivisibleBy4And8(n : number) : boolean { return n % 8 == 0 // As anything divisible by 8 will also be divisible by 4(because 4 is a factor of 8)🤣🤣 }
@jonnysharan4393
8 ай бұрын
one think is also make sure use the right type for right dat to store varible like boolean bigint number and others more check that in google what sre other those type
@TheCricketerKid
Ай бұрын
/ TODO : write a typescript function isDivisibleBy4and8 that takes a number as a parameter and returns true if the number is divisible by both 4 and 8. function isDivisible(a:number){ return (a % 4 == 0) && (a % 8 ==0) } console.log(isDivisible(41));
function isDivisible(a:number):boolean{ return a % 4 === 0 && a % 8 === 0 } console.log(isDivisible(18));
@Star_Walker1
Жыл бұрын
Hi, I am Node js developer, recently joined a company before 5 after course My performance is not good Please make video Node js and steps to become an expert in node js
@nosim442
3 ай бұрын
please make video on how did you get job in company without high knowldege of node.js
@rishiraj2548
Жыл бұрын
Great thanks
@qiratsaeed1897
5 ай бұрын
13.25 is not working
@yachnasoni8241
3 ай бұрын
Assighnment of boolean type is function isDivisibleBy4And8(a: number): boolean { return a % 4 === 0 && a % 8 === 0; } console.log("the number is :", isDivisibleBy4And8(40));
@jonnysharan4393
8 ай бұрын
one thing is also make sure that if you want to add bigInt value to number it will not work make sure you add bigint to bigint or use BigInt() constructer
@MuhammadUsmanAli786
7 ай бұрын
Nice Work!
@user-om7nc5bt4e
3 ай бұрын
function isDivi48(a:number):boolean{ return a%4===0 && a%8 === 0 }
@AdityaSingh-bb6tu
5 ай бұрын
const isDivisible = (a:number):boolean =>{ return (a % 4 === 0 && a % 8 ===0) } console.log(isDivisible(8))
@mahesh1989mah
4 ай бұрын
// TODO : write a typescript function isDivisibleBy4and8 that takes a number as a parameter and returns true if the number is divisible by both 4 and 8. const isDivisibleBy4and8 = (x: number): boolean => { return (x & 3) === 0; }; console.log(isDivisibleBy4and8(36)); // Output: true
@ayanarain4264
3 ай бұрын
Bro ye logic I think aese HOGI: const isDivisibleBy4and8 = (x: number): boolean => { return (x & 7) === 0; }; Kionke agar starting 3 bits ma se koi 1 bhi on hoi to hamara answer 0 nhi aaega or agar agli koi bhi bit on hogi to wo 4 and 8 dono se divisible hogi
@jonnysharan4393
8 ай бұрын
so bigint helps you to store the number which is greater than 2 raise to power 58 thi is regular number for assign the bigint use n at the end of number means suffix :bigint . YOou could also use bingint constructer Bigint() helps you to do the same but first in ts uncomment the version you using es16 to es22 heigher version more is musch good and aslo andd Dom to use
@CHETANRATHOD-eq1bx
Жыл бұрын
while mentioning type BigInt.....what spelling should be write...? either "bigint" or "BigInt.....
@tseringlama2146
Жыл бұрын
hello brother please make a video on (express js) backend and (next js ) frontend about "server side " filtering data and pagination not using server action
@office394
Жыл бұрын
// 1 function isDivide(a:number):boolean { let ans: boolean; if(a%4 === 0 || a%8 === 0){ ans = true } else{ ans = false } return ans } console.log(isDivide(12))
@Product-Pr0
11 ай бұрын
function isdivisible(a:number):boolean{ return a % 4 ===0, } console.log(isDivisible(8));
@shubhamgaygol6737
8 ай бұрын
//Check Number is divible by 4 and 8 or not . function isDivisibleBy4and8(number:number) : string { return (number % 4 == 0 || number % 8 == 0) ? "divisible" : "not divisible"; } let number = 40; console.log(isDivisibleBy4and8(number));
@AdityaSingh-bb6tu
5 ай бұрын
its wrong its told there number is divissible by both 4 and 8
@smsaikat9329
Жыл бұрын
Plz make A-Z
@javascript890
8 ай бұрын
function divide(b:number):boolean{ return (b % 4 ==0 && b % 8 == 0); } console.log(divide(16)); //true
@ParamjitSingh-uq4gm
3 ай бұрын
const isDivisibleBy4And8 = (x: number): boolean => x % 4 == 0 || x % 8 == 0;
@IshanSingh360
6 ай бұрын
Today Work of Boolean : function isDivisibleBy4And8(value: number) { if (value % 4 == 0 && value % 8 == 0) { return true; } else { return false; } } console.log(isDivisibleBy4And8(8));
@Developergirl
2 ай бұрын
// TODO : write a typescript function isDivisibleBy4and8 that takes a //number as a parameter and returns true if the number is divisible by both 4 and 8. const isDivisibleBy4and8 = (x:number):boolean=>{ // return x % 4 === 0 && x & == 0; return x % 4 === 0 && x % 8 === 0; }
Note: You need to know one thing about Bigint that you can't do any arithmatic operation of bigint with number like 18 + 909677987879687n //This is Inavalid you can perform Bigint arithmatic operation only with bigint not with number otherwise it will through error
hello brother please make a video on (express js) backend and (next js ) frontend about "server side " filtering data and pagination not using server action
@nosim442
3 ай бұрын
thik hai me bat krta hu is bare me .
@shivangprajapati5297
13 күн бұрын
function isDivisable4and8(a:number):boolean{ return a % 4 === 0 && a % 8 === 0; } console.log(isDivisable4and8(16));
Пікірлер: 103