Data Types - Beau teaches JavaScript

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 26. 02. 2017
  • Learn about the seven data types in JavaScript ES6 (ECMAScript 6).
    Code
    🔗 codepen.io/beaucarnes/pen/dOxX...
    Other resources on topic:
    🔗 developer.mozilla.org/en-US/d...
    🔗 www.w3schools.com/js/js_dataty...
    Beau Carnes on Twitter: / carnesbeau
    ⭐JavaScript Playlists⭐
    ▶JavaScript Basics: ‱ JavaScript Basics Course
    ▶ES6: ‱ ES6 - Beau teaches Jav...
    ▶Design Patterns: ‱ Design Patterns - Beau...
    ▶Data Structures and Algorithms: ‱ Data Structures and Al...
    ▶Clean Code: ‱ Clean Code - Beau teac...
    -
    We're busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.
    Join our community at freecodecamp.com
    Follow us on twitter: / freecodecamp
    Like us on Facebook: / freecodecamp
    Follow Quincy on Quora: www.quora.com/Quincy-Larson

Komentáƙe • 48

  • @jj006jayj6
    @jj006jayj6 Pƙed 6 lety +18

    When do we use Symbol..exactly..? Excuse me could you write a brief example, please??

  • @Galejandro84
    @Galejandro84 Pƙed 7 lety +9

    great tutorial
    but i think it is a lot much easier to understand Object type:
    var myCar = {
    make = "Ford",
    model = "Mustang"
    };

  • @johnandersmith9990
    @johnandersmith9990 Pƙed 3 lety +1

    Hey thanks for this I've been studying javascript till I got up to this thanks for clarifying these.

  • @libertysomething
    @libertysomething Pƙed 7 lety

    Great Tutorials! i like them

  • @morriswarachi
    @morriswarachi Pƙed 7 lety

    Great tutorial!

  • @BitterMonday
    @BitterMonday Pƙed 4 lety +2

    Need more explanation on symbol and objects

  • @briancox6926
    @briancox6926 Pƙed 7 lety +1

    Do these videos follow along with the original JS track or the new beta JS track better?

    • @BeauCarnes
      @BeauCarnes Pƙed 7 lety +4

      Beta. Check this article if you haven't seen it: medium.freecodecamp.com/my-giant-javascript-basics-course-is-now-live-on-youtube-and-its-100-free-9020a21bbc27

  • @JamesTindall
    @JamesTindall Pƙed 7 lety +3

    var a = function(){}; console.log(typeof a);

  • @sarfaraz111
    @sarfaraz111 Pƙed 6 lety

    var name1 = Symbol("Description 1");
    var name2 = Symbol("Description 2");
    name1 = "John"
    name1 = "Smith"
    console.log(name1);
    If the value are unique than why John is overwriting Smith What is the use of Symbol in this code?

  • @user-fk8zw5js2p
    @user-fk8zw5js2p Pƙed 6 lety +3

    What's the point of:
    var myNumber = null;
    when:
    var myNumber = 0;
    takes fewer keystrokes?

    • @oufcena5092
      @oufcena5092 Pƙed 4 lety +1

      null data type means a variable is neither declared nor assigned (initialized).
      Meanwhile, because of JS type conversion null is evaluated to 0

    • @ToriKo_
      @ToriKo_ Pƙed 4 lety +1

      @ouf cena thanks for answering!

  • @astronaftis3
    @astronaftis3 Pƙed 5 lety +1

    Q: At 6mins, are .make and .model the properties of the Object?
    Thank you for your videos!

    • @oufcena5092
      @oufcena5092 Pƙed 4 lety

      Precisely!

    • @rakinrahman890
      @rakinrahman890 Pƙed 4 lety

      Hmm I don't think so, maybe those are variable name of Ford and Mustang?

  • @stepbystepscience
    @stepbystepscience Pƙed 6 lety

    In the first example you did have to say....if(data === true) {..... I guess it just assumes true first???

  • @Agugz
    @Agugz Pƙed 6 lety +3

    Didn’t understand symbols

  • @rahulbawa6732
    @rahulbawa6732 Pƙed 7 lety +2

    Hi Beau. Thanks for putting so much effort into this . This tutorial is just amazing.
    I have a question. Why does plus operator and multiplication operator behave differently when used with a null value.
    1 + null = 1;
    but
    1 * null = 0;

    • @RogueSergeant
      @RogueSergeant Pƙed 7 lety +2

      Because you're adding 1 to 0. And you can't multiply anything with 0.

    • @jatinc6058
      @jatinc6058 Pƙed 6 lety

      can't you? you can multiply and will get an answer of 0.

  • @9shopir
    @9shopir Pƙed 7 lety

    Hi, nice video, I wonder what text editor are you using?

  • @drdzdd
    @drdzdd Pƙed 4 lety

    Bean means beautiful in French ! Where did you get that name you lucky guy

  • @jatinc6058
    @jatinc6058 Pƙed 6 lety

    Thanks for these tutorials, big fan of FCC. Ok, the undefined and Null is not, ahem, well defined. :). Speaking from what I have learnt from FCC itself, here is an e.g. of undefined -a bit different from Null.
    var test = function(a,b) {
    a+b;
    }
    console.log(test(1,2)); //this will give you undefined

    • @user-we3fg8pv6c
      @user-we3fg8pv6c Pƙed 6 lety

      Could you clarify your example? Seems like your function just doesn't return result. How is it connected to undefined? If you change a + b into return a + b - it's working just fine.

  • @lawrencekin02
    @lawrencekin02 Pƙed 7 lety

    any code editor will do just fine for Javascript

  • @sheikh4awais
    @sheikh4awais Pƙed 7 lety

    which code editor are you using?

    • @BneiAnusim
      @BneiAnusim Pƙed 7 lety

      It looks like codepen.io

    • @lostdesign
      @lostdesign Pƙed 7 lety

      This seems to be codepen.io - i suggest using atom, sublime or vscode. I do switch between sublime and atom from time to time.

    • @BeauCarnes
      @BeauCarnes Pƙed 7 lety

      codepen.io

    • @andrewholdun5375
      @andrewholdun5375 Pƙed 7 lety

      Beau in codepen how do I set it up to see the JS running live on the right?

    • @BeauCarnes
      @BeauCarnes Pƙed 7 lety +1

      In this video I am using Chrome's JavaScript console under 'view->developer->JavaScript Console'. Usually I use CodePen's console. To open click the 'console' button in the bottom left corner. To make CodePen's console appear on the right you have to click 'Change View' in the top right and change the layout.

  • @ToriKo_
    @ToriKo_ Pƙed 4 lety

    Objects in JS seem to work like how I guess you would use a dictionary in Python

  • @rimavedeckiene2203
    @rimavedeckiene2203 Pƙed 2 měsĂ­ci

    Are this course actually in 2024?

  • @JordanWayman
    @JordanWayman Pƙed rokem +1

    The real question is how many people from The odin project are here? đŸ€” TOP RULES!

  • @juancarlosortega7278
    @juancarlosortega7278 Pƙed 5 lety

    console.log("algo que seria genial, es que tuviera subtitulo en español.");

    • @gamingfury228
      @gamingfury228 Pƙed 4 lety

      Something that would be great is that it had a subtitle in Spanish.

  • @ptaczek
    @ptaczek Pƙed 7 lety +1

    Hi, there is no data type null in javascript. If you declare a variable without initialization, it's type is "undefined". But if you initialize the variable to null, it's type is "object". As you said, null is a value that means "no value". Null is not a data type.

    • @BeauCarnes
      @BeauCarnes Pƙed 7 lety +4

      I respectfully disagree. 😊 developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript and docs.microsoft.com/en-us/scripting/javascript/data-types-javascript#the-null-data-type

    •  Pƙed 7 lety

      Beau Carnes acording to ecma-262 Null is a type. null is the only a value

    • @ptaczek
      @ptaczek Pƙed 7 lety +1

      I see. The thing is, these ecma specifications are the ideal tha is not achieved in modern implementations of JS. I doublechecked both latest Chrome and latest Node and there simply is no Null type. The typeof null returns 'object' in both cases. I haven't checked SpiderMonkey though. So from practical perspective there is no Null type you could use to initialize a variable like let n = new Null();

    • @ptaczek
      @ptaczek Pƙed 7 lety

      Call it a bug in JS :) Typeof undefined is 'undefined' but typeof null is 'object'. Specifications are only that: specifications. But whenever you look there is no Null data type you could use in current JS implementations I checked.

  • @aaronargottelopez3488
    @aaronargottelopez3488 Pƙed 4 lety

  • @mdrohimsikder7669
    @mdrohimsikder7669 Pƙed 6 lety

    Your name is very hard............... what a difficult name? I can not synonym it though................

  • @smyasir0
    @smyasir0 Pƙed 5 lety +1

    GRAND SUMMARY
    Booleans - Watch in video.
    Null - means nothing or zero if you do math with it ! Use when some variable has no value assigned to them.
    Undefined - is not similar to null. means that a variable has either not been declared at all OR has been declared but holds no value. yield NaN if you do math with it. Is NOT zero.
    Number - Watch in video.
    Symbols - Their instances are unique and immutable. so if two symbols,
    sym1 = Symbol ("foo") and sym2 = Symbol ("foo") are compared; sym1 === sym2 , it will give false.
    if you typecast them both to string, it will give true ! but typecasting to string also means that it will print like "Symbol(foo)" in console ...
    Object - It is a collection of properties. Properties themselves are key-value pairs.