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 :)
// 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));
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
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
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
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
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
// 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
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
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)🤣🤣 }
/ 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));
Assighnment of boolean type is function isDivisibleBy4And8(a: number): boolean { return a % 4 === 0 && a % 8 === 0; } console.log("the number is :", isDivisibleBy4And8(40));
//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));
// 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; }
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
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
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 :)
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));
// 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));
not && operator try || operator
@@thinkpad6209 If the requirement is to check the divisible status of both 4 and 8, then && is mandatory.
Thank you so much sir.💕💕💕💕💕💕
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
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
please make video on how did you get job in company without high knowldege of node.js
@@nosim442 🤣
Great thanks
function func(a:number):boolean {
return (a%4 && a%8) === 0
}
console.log(func(16))
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
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
Nice Work!
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
function Add(a:number):boolean{
return a % 2 === 0;
}
console.log(Add(4))
boolean Assignment :-
function isEvenbyFourAndEight(a: number): boolean {
let isDivisible = false;
if(a % 4 === 0 && a % 8 === 0){
isDivisible = true;
}
return isDivisible
}
console.log(isEvenbyFourAndEight(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
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
while mentioning type BigInt.....what spelling should be write...? either "bigint" or "BigInt.....
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)🤣🤣
}
function isDivisible(a:number):boolean{
return a % 4 === 0 && a % 8 === 0
}
console.log(isDivisible(18));
/ 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,
}
console.log(isDivisible(8));
Nextjs13 ki series ane wali hai kya???
3 sal bad yad dilana waps .
Plz make A-Z
function divide(b:number):boolean{
return (b % 4 ==0 && b % 8 == 0);
}
console.log(divide(16)); //true
Assighnment of boolean type is
function isDivisibleBy4And8(a: number): boolean {
return a % 4 === 0 && a % 8 === 0;
}
console.log("the number is :", isDivisibleBy4And8(40));
// 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))
const isDivisible = (a:number):boolean =>{
return (a % 4 === 0 && a % 8 ===0)
}
console.log(isDivisible(8))
boolean ka Assignment -->
function isDivisibleBy4And8(num: number): boolean {
if (num % 4 === 0 && num % 8 === 0) {
return true;
}
return false;
}
console.log("Answer 2:");
console.log(isDivisibleBy4And8(16));
console.log(isDivisibleBy4And8(12));
function isDivi48(a:number):boolean{
return a%4===0 && a%8 === 0
}
function isDivisibleBy4And8(a: number): boolean {
return a % 4 === 0 && a % 8 === 0
}
console.log(isDivisibleBy4And8(16))
13.25 is not working
const divide48 = (n:number):boolean => {
return ((n % 4 === 0 && n % 8 === 0)? true : false)
}
console.log((divide48)(16))
console.log((divide48)(17))
Hello developer, devknus
//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));
its wrong its told there number is divissible by both 4 and 8
Today Work of Boolean : function isDivisibleBy4And8(value: number) {
if (value % 4 == 0 && value % 8 == 0) {
return true;
} else {
return false;
}
}
console.log(isDivisibleBy4And8(8));
const isDivisibleBy4and8=(a:number):boolean=>{
if(a%4===0 && a%8===0){
return true
}return false
}
const isDivisibleBy4And8=(NumberValue:number):boolean=>NumberValue%4===0 && NumberValue%8===0
8:14 😂😂😂😂
function isDivisible(num: number): boolean{
return num%4===0 && num%8===0
}
console.log(isDivisible(16));
const isDivisibleBy4And8 = (x: number): boolean => x % 4 == 0 || x % 8 == 0;
function isDevidable(a:number,b:number){
return a%4 === 0 && b%8 === 0
}
console.log(isDevidable(16,16));
// 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;
}
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
function isDivisableByFourandEight(a:number):boolean{
return ((a%4===0)&&(a%8===0))
}
console.log(isDivisableByFourandEight(32));
bigint no nhi smjh aya?
❤❤op
Boolean Assignment:
function isDivisiableby4and8(a: number):boolean {
if(a % 4 === 0 && a % 8 === 0){
return true;
} else{
return false;
}
}
function isDivi(n:number):boolean{
return n%4 ==0 && n%8 ==0 ? true :false
}
where is the source code
boolean type assiment
function isDivisibleBy4And8(a, b) {
if (a % 4 === 0 && b % 8 === 0) {
return true;
}
else {
return false;
}
}
console.log("===== isDivisibleBy4And8 =====", isDivisibleBy4And8(24, 42));
function isDividedBy4And8(num:number):boolean{
if(num%4 === 0 && num%8 === 0){
return true
}else{
return false
}
}
console.log(isDividedBy4And8(12))
let divisible = (a: number): boolean => {
return a % 4 === 0 && a % 8 === 0;
};
function isDivisibleBy4and8(value) {
if (value % 4 === 0 && value % 8 === 0) {
return true;
}
return false;
}
console.log(isDivisibleBy4and8(40));
function isDivisible(param) {
if (param % 4 === 0) {
return true;
}
else {
return false;
}
}
console.log(isDivisible(10));
timeStamp 13:21 My code is running no problem
// HomeWork : divisible by 4,8 then return true
const divisibleBy48 = (n:number):boolean =>{
return ((n%4===0 && n%8===0)?true:false);
}
console.log(divisibleBy48(16));
console.log(divisibleBy48(15));
Good
function isDivisibleBy4and8(a) {
if (a % 4 == 0 && a % 8 == 0) {
return true;
}
else {
return false;
}
}
console.log(isDivisibleBy4and8(12));
//Todo
solution:
function isDivisibleBy4And8(a:number):boolean{
return a%4 === 0 && a%8 === 0;
}
console.log(isDivisibleBy4And8(16));
///OUTPUT : true
function isDivisibleBy4And8(n: number): boolean {
return (n % 1000) % 8 === 0;
}
console.log(isDivisibleBy4And8(16));
const isDivisibleBy4and8 =(a:number):boolean=>{
return (a%4===0 && a%8===0)
}
console.log(isDivisibleBy4and8(8))
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
const divisibelBy4And8 = (num:number):boolean =>{
if(num%4===0 && num%8===0){
return true
}else{
return false;
}
}
console.log(divisibelBy4And8(60))
7:13 const isDivisibleBy4&8 = (num:number):boolean =>{
return num % 4 === 0 && num % 8 ===0
}
console.log(isDivisibleBy4&8(16));
16:55 const bigNum:bigint =568546474747n;
const anotherBigNum = BigInt("6847589406356");
console.log(bigNum - anotherBigNum);
console.log(bigNum * anotherBigNum);
console.log(bigNum / anotherBigNum);
Awesome
@@ThapaTechnical *_THANK YOU BHAI_* 🙏🏻
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
thik hai me bat krta hu is bare me .
function isDivisable4and8(a:number):boolean{
return a % 4 === 0 && a % 8 === 0;
}
console.log(isDivisable4and8(16));
where is the source code
const divisibelBy4And8 = (num:number):boolean =>{
if(num%4===0 && num%8===0){
return true
}else{
return false;
}
}
console.log(divisibelBy4And8(20))
Awesome
@@ThapaTechnical 😊
Bro you don't need to write else block
@@itzallabouttech3616 sahi baat
function isDivisible(num:number):boolean{
return num%4==0&&num%8==0;
}
console.log(isDivisible(18));