#5: Typescript Boolean and Bigint Types with Practical Examples🔥Typescript Tutorial in Hindi

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2024

ความคิดเห็น • 107

  • @ThapaTechnical
    @ThapaTechnical  ปีที่แล้ว +27

    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
      @web-dev.ashishk ปีที่แล้ว

      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
    @vishalbrow ปีที่แล้ว +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.
    const isDivisibleBy4and8 = (x: number): boolean => {
    return x % 4 === 0 && x % 8 === 0;
    }
    console.log(isDivisibleBy4and8(32));

    • @thinkpad6209
      @thinkpad6209 หลายเดือนก่อน

      not && operator try || operator

    • @taymurnaeem
      @taymurnaeem 8 วันที่ผ่านมา

      @@thinkpad6209 If the requirement is to check the divisible status of both 4 and 8, then && is mandatory.

  • @jagdishjena9058
    @jagdishjena9058 ปีที่แล้ว

    Thank you so much sir.💕💕💕💕💕💕

  • @jonnysharan4393
    @jonnysharan4393 9 หลายเดือนก่อน

    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

  • @Star_Walker1
    @Star_Walker1 ปีที่แล้ว +1

    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
      @nosim442 4 หลายเดือนก่อน

      please make video on how did you get job in company without high knowldege of node.js

    • @raghwendrachouhan4136
      @raghwendrachouhan4136 5 วันที่ผ่านมา

      @@nosim442 🤣

  • @rishiraj2548
    @rishiraj2548 ปีที่แล้ว

    Great thanks

  • @UdayLakhana
    @UdayLakhana ปีที่แล้ว +2

    function func(a:number):boolean {
    return (a%4 && a%8) === 0
    }
    console.log(func(16))

  • @jonnysharan4393
    @jonnysharan4393 9 หลายเดือนก่อน

    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

  • @jonnysharan4393
    @jonnysharan4393 9 หลายเดือนก่อน

    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

  • @MuhammadUsmanAli786
    @MuhammadUsmanAli786 8 หลายเดือนก่อน

    Nice Work!

  • @tseringlama2146
    @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

  • @1saurabh352
    @1saurabh352 2 หลายเดือนก่อน

    function Add(a:number):boolean{
    return a % 2 === 0;
    }
    console.log(Add(4))

  • @CosMIcAkaSh1111
    @CosMIcAkaSh1111 2 หลายเดือนก่อน

    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))

  • @mahesh1989mah
    @mahesh1989mah 5 หลายเดือนก่อน

    // 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
      @ayanarain4264 4 หลายเดือนก่อน

      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

  • @CHETANRATHOD-eq1bx
    @CHETANRATHOD-eq1bx ปีที่แล้ว

    while mentioning type BigInt.....what spelling should be write...? either "bigint" or "BigInt.....

  • @AniketMohan
    @AniketMohan 7 หลายเดือนก่อน

    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)🤣🤣
    }

  • @devarshpanchal2885
    @devarshpanchal2885 ปีที่แล้ว +3

    function isDivisible(a:number):boolean{
    return a % 4 === 0 && a % 8 === 0
    }
    console.log(isDivisible(18));

  • @TheCricketerKid
    @TheCricketerKid 3 หลายเดือนก่อน

    / 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));

  • @Product-Pr0
    @Product-Pr0 ปีที่แล้ว

    function isdivisible(a:number):boolean{
    return a % 4 ===0,
    }
    console.log(isDivisible(8));

  • @Tausif_Khan_07
    @Tausif_Khan_07 ปีที่แล้ว

    Nextjs13 ki series ane wali hai kya???

    • @nosim442
      @nosim442 4 หลายเดือนก่อน

      3 sal bad yad dilana waps .

  • @smsaikat9329
    @smsaikat9329 ปีที่แล้ว

    Plz make A-Z

  • @javascript890
    @javascript890 9 หลายเดือนก่อน

    function divide(b:number):boolean{
    return (b % 4 ==0 && b % 8 == 0);
    }
    console.log(divide(16)); //true

  • @yachnasoni8241
    @yachnasoni8241 4 หลายเดือนก่อน

    Assighnment of boolean type is
    function isDivisibleBy4And8(a: number): boolean {
    return a % 4 === 0 && a % 8 === 0;
    }
    console.log("the number is :", isDivisibleBy4And8(40));

  • @office394
    @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))

  • @AdityaSingh-bb6tu
    @AdityaSingh-bb6tu 7 หลายเดือนก่อน

    const isDivisible = (a:number):boolean =>{
    return (a % 4 === 0 && a % 8 ===0)
    }
    console.log(isDivisible(8))

  • @rishabhtripathi6032
    @rishabhtripathi6032 11 หลายเดือนก่อน

    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));

  • @VikramBais-k7v
    @VikramBais-k7v 4 หลายเดือนก่อน

    function isDivi48(a:number):boolean{
    return a%4===0 && a%8 === 0
    }

  • @vsandhudeveloper3282
    @vsandhudeveloper3282 ปีที่แล้ว

    function isDivisibleBy4And8(a: number): boolean {
    return a % 4 === 0 && a % 8 === 0
    }
    console.log(isDivisibleBy4And8(16))

  • @qiratsaeed1897
    @qiratsaeed1897 6 หลายเดือนก่อน +1

    13.25 is not working

  • @thesmartideas4246
    @thesmartideas4246 ปีที่แล้ว

    const divide48 = (n:number):boolean => {
    return ((n % 4 === 0 && n % 8 === 0)? true : false)
    }
    console.log((divide48)(16))
    console.log((divide48)(17))

  • @iaMac33
    @iaMac33 ปีที่แล้ว

    Hello developer, devknus

  • @shubhamgaygol6737
    @shubhamgaygol6737 10 หลายเดือนก่อน

    //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
      @AdityaSingh-bb6tu 7 หลายเดือนก่อน

      its wrong its told there number is divissible by both 4 and 8

  • @IshanSingh360
    @IshanSingh360 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));

  • @itzallabouttech3616
    @itzallabouttech3616 ปีที่แล้ว

    const isDivisibleBy4and8=(a:number):boolean=>{
    if(a%4===0 && a%8===0){
    return true
    }return false
    }

  • @yogitataluja1058
    @yogitataluja1058 ปีที่แล้ว

    const isDivisibleBy4And8=(NumberValue:number):boolean=>NumberValue%4===0 && NumberValue%8===0

  • @47_sychogamer47
    @47_sychogamer47 หลายเดือนก่อน

    8:14 😂😂😂😂

  • @sukanyasinha3583
    @sukanyasinha3583 ปีที่แล้ว

    function isDivisible(num: number): boolean{
    return num%4===0 && num%8===0
    }
    console.log(isDivisible(16));

  • @ParamjitSingh-uq4gm
    @ParamjitSingh-uq4gm 5 หลายเดือนก่อน

    const isDivisibleBy4And8 = (x: number): boolean => x % 4 == 0 || x % 8 == 0;

  • @sidd_shaikh
    @sidd_shaikh ปีที่แล้ว

    function isDevidable(a:number,b:number){
    return a%4 === 0 && b%8 === 0
    }
    console.log(isDevidable(16,16));

  • @Developergirl
    @Developergirl 3 หลายเดือนก่อน

    // 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;
    }

  • @jonnysharan4393
    @jonnysharan4393 9 หลายเดือนก่อน

    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

  • @diptadipsaha4086
    @diptadipsaha4086 7 หลายเดือนก่อน

    function isDivisableByFourandEight(a:number):boolean{
    return ((a%4===0)&&(a%8===0))
    }
    console.log(isDivisableByFourandEight(32));

  • @sahibarehmatali
    @sahibarehmatali 9 หลายเดือนก่อน

    bigint no nhi smjh aya?

  • @Radhe_radhe2929
    @Radhe_radhe2929 ปีที่แล้ว

    ❤❤op

  • @SyedaNoor-v6o
    @SyedaNoor-v6o 6 หลายเดือนก่อน

    Boolean Assignment:
    function isDivisiableby4and8(a: number):boolean {
    if(a % 4 === 0 && a % 8 === 0){
    return true;
    } else{
    return false;
    }
    }

  • @honestslave
    @honestslave ปีที่แล้ว

    function isDivi(n:number):boolean{
    return n%4 ==0 && n%8 ==0 ? true :false
    }

  • @AjeetYadav-v7u
    @AjeetYadav-v7u 7 หลายเดือนก่อน

    where is the source code

  • @gaudanikaushik1849
    @gaudanikaushik1849 หลายเดือนก่อน

    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));

  • @chetangupta2130
    @chetangupta2130 ปีที่แล้ว +3

    function isDividedBy4And8(num:number):boolean{
    if(num%4 === 0 && num%8 === 0){
    return true
    }else{
    return false
    }
    }
    console.log(isDividedBy4And8(12))

  • @adityasinghrawat4429
    @adityasinghrawat4429 ปีที่แล้ว

    let divisible = (a: number): boolean => {
    return a % 4 === 0 && a % 8 === 0;
    };

  • @anupdhakal69
    @anupdhakal69 2 หลายเดือนก่อน

    function isDivisibleBy4and8(value) {
    if (value % 4 === 0 && value % 8 === 0) {
    return true;
    }
    return false;
    }
    console.log(isDivisibleBy4and8(40));

  • @ilyazzz_31
    @ilyazzz_31 ปีที่แล้ว

    function isDivisible(param) {
    if (param % 4 === 0) {
    return true;
    }
    else {
    return false;
    }
    }
    console.log(isDivisible(10));

  • @web-dev.ashishk
    @web-dev.ashishk ปีที่แล้ว

    timeStamp 13:21 My code is running no problem

  • @lokeshwarprasad9614
    @lokeshwarprasad9614 ปีที่แล้ว +2

    // 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));

  • @krushnathakare2300
    @krushnathakare2300 11 หลายเดือนก่อน

    function isDivisibleBy4and8(a) {
    if (a % 4 == 0 && a % 8 == 0) {
    return true;
    }
    else {
    return false;
    }
    }
    console.log(isDivisibleBy4and8(12));

  • @spideygaming5103
    @spideygaming5103 ปีที่แล้ว

    //Todo
    solution:
    function isDivisibleBy4And8(a:number):boolean{
    return a%4 === 0 && a%8 === 0;
    }
    console.log(isDivisibleBy4And8(16));
    ///OUTPUT : true

  • @nayyarabbas4482
    @nayyarabbas4482 ปีที่แล้ว

    function isDivisibleBy4And8(n: number): boolean {
    return (n % 1000) % 8 === 0;
    }
    console.log(isDivisibleBy4And8(16));

  • @CHETANRATHOD-eq1bx
    @CHETANRATHOD-eq1bx ปีที่แล้ว

    const isDivisibleBy4and8 =(a:number):boolean=>{
    return (a%4===0 && a%8===0)
    }
    console.log(isDivisibleBy4and8(8))

  • @itzallabouttech3616
    @itzallabouttech3616 ปีที่แล้ว

    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

  • @shivamsoni7974
    @shivamsoni7974 ปีที่แล้ว

    const divisibelBy4And8 = (num:number):boolean =>{
    if(num%4===0 && num%8===0){
    return true
    }else{
    return false;
    }
    }
    console.log(divisibelBy4And8(60))

  • @DEEPANSHU_NAG
    @DEEPANSHU_NAG ปีที่แล้ว

    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);

  • @tseringlama2146
    @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

    • @nosim442
      @nosim442 4 หลายเดือนก่อน

      thik hai me bat krta hu is bare me .

  • @shivangprajapati5297
    @shivangprajapati5297 หลายเดือนก่อน

    function isDivisable4and8(a:number):boolean{
    return a % 4 === 0 && a % 8 === 0;
    }
    console.log(isDivisable4and8(16));

  • @AjeetYadav-v7u
    @AjeetYadav-v7u 7 หลายเดือนก่อน

    where is the source code

  • @rajaramsingh1986
    @rajaramsingh1986 ปีที่แล้ว

    const divisibelBy4And8 = (num:number):boolean =>{
    if(num%4===0 && num%8===0){
    return true
    }else{
    return false;
    }
    }
    console.log(divisibelBy4And8(20))

  • @terabapaya556
    @terabapaya556 ปีที่แล้ว

    function isDivisible(num:number):boolean{
    return num%4==0&&num%8==0;
    }
    console.log(isDivisible(18));