|
INTERVIEW QUESTIONS
WEB
JAVA SCRIPT
DETAILS
Question: How is JavaScript syntax like C / C++?
Answer: The languages have enough in common to make learning one easy if you know the other. By the same token, the differences are subtle enough to trip up those proficient in both. Here's a short list comparing C and JavaScript:
* Terminating JavaScript command lines in semicolons is optional; in C it's mandatory. Recommended practice is to use them religiously in both languages (and Java as well). * Both JavaScript and C are case-sensitive; 'doThis' is different from 'DOTHIS'. Experienced programmers learn to love this feature, which drives beginners nuts. * Both JavaScript and C are block-structured computer languages and employ curly brackets -- '{' and '}' -- to delimit blocks. * Both JavaScript and C employ quotation -- enclosure in single or double quote marks -- to designate text strings. * Arrays in both JavaScript and C are zero-based; the first element is myArray[0], not myArray[1]. * Both JavaScript and C employ '==' for comparison, '=' for equality, and '!' for negation. In fact the set of JavaScript operators is essentially borrowed from C (right down to the deprecated ternary construct a ? b : c). * Both JavaScript and C employ the symbols /* to designate a comment */. JavaScript also permits the use of '//' for short comments, as in C++.
Finally, JavaScript's statements are a strict subset of C++'s, offering a smaller selection of identical looping and conditional constructs.
|
|
|
Category |
Java Script Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 7811 users |
Added on |
10/6/2012 4:48:54 AM |
Views |
66848 |
Rate it! |
|
|
Question:
How is JavaScript syntax like C / C++?
Answer:
The languages have enough in common to make learning one easy if you know the other. By the same token, the differences are subtle enough to trip up those proficient in both. Here's a short list comparing C and JavaScript:
* Terminating JavaScript command lines in semicolons is optional; in C it's mandatory. Recommended practice is to use them religiously in both languages (and Java as well). * Both JavaScript and C are case-sensitive; 'doThis' is different from 'DOTHIS'. Experienced programmers learn to love this feature, which drives beginners nuts. * Both JavaScript and C are block-structured computer languages and employ curly brackets -- '{' and '}' -- to delimit blocks. * Both JavaScript and C employ quotation -- enclosure in single or double quote marks -- to designate text strings. * Arrays in both JavaScript and C are zero-based; the first element is myArray[0], not myArray[1]. * Both JavaScript and C employ '==' for comparison, '=' for equality, and '!' for negation. In fact the set of JavaScript operators is essentially borrowed from C (right down to the deprecated ternary construct a ? b : c). * Both JavaScript and C employ the symbols /* to designate a comment */. JavaScript also permits the use of '//' for short comments, as in C++.
Finally, JavaScript's statements are a strict subset of C++'s, offering a smaller selection of identical looping and conditional constructs. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How does JavaScript model the world?
|
View Answer
|
|
What are the language's basic entities?
|
View Answer
|
|
Where is the official bug list for JavaScript?
|
View Answer
|
|
Where can I find online documentation for JavaScript?
|
View Answer
|
|
What is JavaScript?
|
View Answer
|
|
How i will use email validation in java script, Like. User can't enter invalid email address?
|
View Answer
|
|
What is the main difference between Client side Java Script and and Server side Java Script how actully they run on both side with Example
|
View Answer
|
|
I do not want to go next field without filling the text? Whic function i should use. Phone No Text validation in javascript
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Java Script Interview Questions & Answers - Exam Mode /
Learning Mode
|