Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between C language and javascript

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about what's the difference between c and javascript. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. C language is mainly compiled into machine language, and JavaScript is mainly interpreted and executed as a script by the interpreter.

2. C language requires programmers to manage memory manually, and JS memory is managed by an interpreter.

3. C is a statically typed language and JS is a dynamically typed language.

4. There is no concept of closure in C language, but in JS.

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:

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 BF1 to variable a" rather than "the value of variable an is equal to the value of variable BF1"

Assignment is an expression that can be used as a value to participate in other operations, such as: (a=b+1) > 10

Statement ends with a semicolon

Start with "0x" to represent a hexadecimal number

Use "&" | ^ ""! "& &" | | "as the operators of bitwise and, bitwise OR, bitwise XOR, logical non, logical and, logical or operation, respectively.

A ternary operator consisting of a question mark and a colon

Precedence order of multiplication and division operators, addition and subtraction operators, comparison operators, logic and logic or operators, assignment operators

The syntax of a function call is "function name (parameter 1, parameter 2,.)"

Put the code block in curly braces

Syntax of if, for, while, do-while, switch-case, break

Thank you for reading! This is the end of the article on "what's the difference between c language and javascript". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report