diff --git a/1-js/05-data-types/01-primitives-methods/article.md b/1-js/05-data-types/01-primitives-methods/article.md index 4d40cd5d..a40fdf55 100644 --- a/1-js/05-data-types/01-primitives-methods/article.md +++ b/1-js/05-data-types/01-primitives-methods/article.md @@ -1,19 +1,22 @@ # Methods of primitives -JavaScript allows us to work with primitives (strings, numbers etc) as if they were objects. +JavaScript allows us to work with primitives (strings, numbers, etc.) as if they were objects. -They also provide methods to call as such. We will study those soon, but first we'll see how it works, because, of course, primitives are not objects (and here we will make it even more clear). +They also provide methods to call as such. We will study those soon, but first we'll see how it works because, of course, primitives are not objects (and here we will make it even clearer). -Let's look at the key distinction between primitives and objects. +Let's look at the key distinctions between primitives and objects. A primitive -: Is a value of a primitive type. There are 6 primitive types: `string`, `number`, `boolean`, `symbol`, `null` and `undefined`. + +- Is a value of a primitive type. +- There are 6 primitive types: `string`, `number`, `boolean`, `symbol`, `null` and `undefined`. An object -: Is capable of storing multiple values as properties. -Can be created with `{}`, for instance: `{name: "John", age: 30}`. There are other kinds of objects in JavaScript, e.g. functions are objects. -One of the best things about objects is that we can store a function as one of its properties: +- Is capable of storing multiple values as properties. +- Can be created with `{}`, for instance: `{name: "John", age: 30}`. There are other kinds of objects in JavaScript; functions, for example, are objects. + +One of the best things about objects is that we can store a function as one of its properties. ```js run let john = { @@ -28,7 +31,7 @@ john.sayHi(); // Hi buddy! So here we've made an object `john` with the method `sayHi`. -Many built-in objects already exist, such as those that work with dates, errors, HTML elements etc. They have different properties and methods. +Many built-in objects already exist, such as those that work with dates, errors, HTML elements, etc. They have different properties and methods. But, these features come with a cost!