How would you explain to a layman that everything is an object in JavaScript, when he doesn't know what an object is in computer
To give a completely different answer: Besides being a bigger truth in other programming languages, in very short this means a language has a better discoverability of available functionalities and properties.It surely also makes the statement this language is object-oriented.What does discoverability mean? Letâs start with BASIC as another complete beginner language, that works with commands and functions. Letâs look into a very simple detail, outputting data, something every program surely does the one or other way. What you need to output any type of data is its string representation. A string is simply the type of data in a computer which roughly spoken is printable human-readable text, eg a number in decimal digits instead of a binary or hexadecimal representation of it in memory.BASIC will have several functions to turn anything into a string or evaluate a string to a binary form, eg STR(1) will produce the string â1â (the quotes are delimiters of the string value. So what seems natural, that 1 is output as 1, actually needs a conversion. Dates, for example, in a Unix specification are stored as number of seconds since January 1st, 1970 midnight, what would that help you to know that you want it as day, month, year the one or other order and separator will depend on your country, but surely you wouldnât want to calculate what you get when you add many millions of seconds to that initial point in time.Since there are several data types in programming languages and you can define new types there also are many functions to know, vocabulary. It would be simple if STR would convert anything to string, but a basic variant for dates is FORMAT(date,âmm/dd/yyyyâ).With a language supporting that concept you likely will have a way to have some data inside a variable var and turn it into a string with var.ToString . And here comes the meaning of discoverability: Itâs not just consistent naming of the functionality, while you program, you have support from the editor about syntax of what you write, quite like a grammar and spelling checker but in this case simply writing the dot after the variable name you get a list of things your code could do now.So this in general then also means more rapid development. It doesnât go as far as starting to program today this assistance does everything for you, but a basis like that helps a lot to need less time looking into reference manuals. Note, this is not just limited to simple types, it just is quite the norm to be that case for more complex types or classes, but in such programming languages, it even goes down to simple types and constants. And there are much different and more complicated features than converting something to a string. You can sometimes really look whatâs offered easier this way than reading third-party library documentation or reference, though the digital reference in the form of code of a class also can be jumped to with a keypress in some IDEs, you also can type partial words youâd expect and get the list filtered for containing that, so itâsIn the extreme case even constant data like a number itself will offer the toString method, so you could do 42.toString , though itâs simpler to write that in code as â42â, but the principle counts, you find all functionality you can do with a type and such assistance (intellisense or autocomplete features) are quite a norm in programming today, third-party tools extend that even further, e ReSharper assist writing C# code in very many aspects up to complex things like refactoring code. I know this is just a word without meaning but in short this assists with far more than just creating the current single command or line of code correctly.So, âeverything is an objectâ is pointing out a good and desirable quality of an OOP programming language.