Skip to content

Some minor changes up to no. ~160. Feel free to correct or ignore :-) #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
Small clarification on 95
  • Loading branch information
ckpinguin authored Feb 5, 2025
commit 87b60cd666d99766d10e106b56b9e83f2440fd10
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2167,13 +2167,13 @@

95. ### What is the difference between an attribute and a property

Attributes are defined on the HTML markup whereas properties are defined on the DOM. For example, the below HTML element has 2 attributes type and value,
Attributes are defined on the HTML markup whereas properties are defined on the DOM. For example, the below HTML element has 2 attributes: `type` and `value`,

```javascript
<input type="text" value="Name:">
```

You can retrieve the attribute value as below,
You can retrieve the attribute value as below, for example after typing "Good morning" into the input field:

```javascript
const input = document.querySelector("input");
Expand All @@ -2190,13 +2190,13 @@

**[⬆ Back to Top](#table-of-contents)**

96. ### What is same-origin policy
97. ### What is same-origin policy

The same-origin policy is a policy that prevents JavaScript from making requests across domain boundaries. An origin is defined as a combination of URI scheme, hostname, and port number. If you enable this policy then it prevents a malicious script on one page from obtaining access to sensitive data on another web page using Document Object Model(DOM).

**[⬆ Back to Top](#table-of-contents)**

97. ### What is the purpose of void 0
98. ### What is the purpose of void 0

Void(0) is used to prevent the page from refreshing. This will be helpful to eliminate the unwanted side-effect, because it will return the undefined primitive value. It is commonly used for HTML documents that use href="JavaScript:Void(0);" within an `<a>` element. i.e, when you click a link, the browser loads a new page or refreshes the same page. But this behavior will be prevented using this expression.
For example, the below link notify the message without reloading the page
Expand All @@ -2209,19 +2209,19 @@

**[⬆ Back to Top](#table-of-contents)**

98. ### Is JavaScript a compiled or interpreted language
99. ### Is JavaScript a compiled or interpreted language

JavaScript is an interpreted language, not a compiled language. An interpreter in the browser reads over the JavaScript code, interprets each line, and runs it. Nowadays modern browsers use a technology known as Just-In-Time (JIT) compilation, which compiles JavaScript to executable bytecode just as it is about to run.

**[⬆ Back to Top](#table-of-contents)**

99. ### Is JavaScript a case-sensitive language
100. ### Is JavaScript a case-sensitive language

Yes, JavaScript is a case sensitive language. The language keywords, variables, function & object names, and any other identifiers must always be typed with a consistent capitalization of letters.

**[⬆ Back to Top](#table-of-contents)**

100. ### Is there any relation between Java and JavaScript
101. ### Is there any relation between Java and JavaScript

No, they are entirely two different programming languages and have nothing to do with each other. But both of them are Object Oriented Programming languages and like many other languages, they follow similar syntax for basic features(if, else, for, switch, break, continue etc).

Expand Down