In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly talks about "what are the differences between javascript and c language". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what's the difference between javascript and c"!
The operating environment of this tutorial: windows7 system, javascript1.8.5&&c99 version, Dell G3 computer.
JavaScript (JS for short) is a lightweight, interpretive or just-in-time programming language with function priority. Although it is known as a scripting language for developing Web pages, it is also used in many non-browser environments. JavaScript is based on prototype programming, multi-paradigm dynamic scripting language, and supports object-oriented, imperative, declarative, and functional programming paradigms.
C language is a process-oriented and abstract general programming language, which is widely used in low-level development. C language can compile and process low-level memory in a simple way. C language is an efficient programming language that produces only a small number of machine languages and can run without any running environment support. Although C language provides many low-level processing functions, it still maintains cross-platform features. C language programs written in a standard specification can be compiled on many computer platforms, including operating platforms such as embedded processors and supercomputers.
The difference between javascript and c language
1. C language is mainly compiled into machine language, while JavaScript is mainly interpreted and executed by the interpreter as a script.
2. C language requires programmers to manage memory manually (mainly refers to the application and release of heap memory), while JavaScript memory is managed by the interpreter.
3. C language is a statically typed language, that is, the data type of each variable has been determined before the program runs and cannot be changed at run time, while JavaScript is a dynamically typed language, and the data type of variables can still be changed at run time.
4. There is no concept of closure in C language. Functions in JavaScript form closures with variables that can be accessed when they are defined.
5. C language does not support object-oriented features such as "class member method", "class member encapsulation (invisible to the outside)", "class inheritance and polymorphism", while JavaScript can realize object-oriented inheritance, polymorphism and encapsulation through prototype chains and closures. JavaScript for ECMAScript 2015 and above supports class definition at the syntax level.
6. C language can implement multithreading by calling system API, and multithreading can be used to improve the utilization of CPU during blocking operations (mainly IO), while JavaScript is mainly single-threaded. All possible blocking operations of JavaScript are accomplished by asynchronous API provided by JavaScript runtime.
Similarities between javascript and c languages
Some words and grammar are the same. JavaScript's lexical grammar is designed with reference to Java, while Java's lexical grammar is designed with reference to C. JavaScript, Java, C++ and C all share the same morphology and grammar that I can think of:
1. Use a single equal sign as an assignment operator rather than an equality judgment operator. For example, a=b+1 stands for "assigning the result of variable BBQ 1 to variable a" rather than "the value of variable an is equal to that of variable BF1"
2. Assignment is an expression that can be used as a value to participate in other operations, such as: (a=b+1) > 10
3. The statement ends with a semicolon
4. Start with "0x" to represent hexadecimal numbers
5. Use "&" | "^"!" & & "| |" as the operators of bitwise and, bitwise OR, bitwise XOR, logical non, logical and, logical or operation, respectively.
6. Ternary operators consisting of question marks and colons
7. Precedence order of multiplication and division operators, addition and subtraction operators, comparison operators, logic and logic or operators, assignment operators
8. The syntax of the function call is "function name (parameter 1, parameter 2,.)"
9. Put the code block in curly braces
10. Syntax of if, for, while, do-while, switch-case, break
At this point, I believe you have a deeper understanding of "what is the difference between javascript and c language". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.