From 7e3e74fa5ba94260e6e9c5d64742f187b5dc21e2 Mon Sep 17 00:00:00 2001 From: Mustafa Kemal Tuna <12192118+lumosmind@users.noreply.github.com> Date: Tue, 5 Nov 2019 13:50:42 +0300 Subject: [PATCH] "syntactic sugar" instead of "syntax sugar" historically and in general use this phenomena is called as "syntactic sugar". I think we can change it for understand-ability and engineering convention. https://www.computerhope.com/jargon/s/syntactic-sugar.htm --- 1-js/09-classes/01-class/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/09-classes/01-class/article.md b/1-js/09-classes/01-class/article.md index 4aaf52bd45..30ab6a71a9 100644 --- a/1-js/09-classes/01-class/article.md +++ b/1-js/09-classes/01-class/article.md @@ -116,9 +116,9 @@ alert(User.prototype.sayHi); // alert(this.name); alert(Object.getOwnPropertyNames(User.prototype)); // constructor, sayHi ``` -## Not just a syntax sugar +## Not just a syntactic sugar -Sometimes people say that `class` is a "syntax sugar" (syntax that is designed to make things easier to read, but doesn't introduce anything new), because we could actually declare the same without `class` keyword at all: +Sometimes people say that `class` is a "syntactic sugar" (syntax that is designed to make things easier to read, but doesn't introduce anything new), because we could actually declare the same without `class` keyword at all: ```js run // rewriting class User in pure functions @@ -140,7 +140,7 @@ let user = new User("John"); user.sayHi(); ``` -The result of this definition is about the same. So, there are indeed reasons why `class` can be considered a syntax sugar to define a constructor together with its prototype methods. +The result of this definition is about the same. So, there are indeed reasons why `class` can be considered a syntactic sugar to define a constructor together with its prototype methods. Still, there are important differences.