Closed Thread
Thread Tools Search this Thread
Unread 30th Mar 2024, 12:34 PM   #1
MagicLouieServices.com
War Room Member
 
magiclouie's Avatar
 
Join Date: 2010
Location: Pearl of the Orient Seas, Philippines
Posts: 1,275
Thanks: 312
Thanked 526 Times in 365 Posts
Blog Entries: 2
Default
Is 'div' a Parameter or an Argument in JavaScript's document.createElement Method?
Share on: 
fb share twitter share gplus share more share

Hello Fellow Warriors,

In JavaScript's document.createElement('div'), is 'div' a parameter or an argument? While checking https://developer.mozilla.org/en-US/.../createElement, I noticed the section titled "Parameters."

However, upon further research, I found other resources referring to it as "arguments." In the context of function calls in JavaScript, 'div' is an argument. You pass this string to specify the type of element you want to create. It is not considered a parameter when you are calling the createElement method. For instance, in document.createElement('div'), 'div' is the argument you provide to create a <div> element.

Thanks a lot.
magiclouie is offline  
Unread 6th Apr 2024, 02:52 PM   #2
Midnight Oil Warrior
 
Join Date: 2013
Location: Bridgeport, WV.
Posts: 6,796
Thanks: 3,622
Thanked 6,636 Times in 3,502 Posts
Default
Re: Is 'div' a Parameter or an Argument in JavaScript's document.createElement Method?
Share on: 
fb share twitter share gplus share more share

to be honest i dont consider div to be either a Parameter or an Argument, its simply a division element that divides the html tag.

Yeah you can alter the tag... but you are then introducing "decorateDiv(div)" or the like, and its really not the same thing

A div is just that, a div... even in the case of a defined decorate div... its still a div

Success is an ACT not an idea
savidge4 is offline  
Unread 22nd Apr 2024, 08:29 AM   #3
Active Warrior
 
Join Date: 2022
Posts: 32
Thanks: 2
Thanked 26 Times in 13 Posts
Default
RE: Is 'div' a Parameter or an Argument in JavaScript's document.createElement Method?
Share on: 
fb share twitter share gplus share more share

In other languages there is also a case like this, for example a class object can be an object and also a parameter to another object, so if I'm not wrong you simply need to see the context and different elements can take on different roles, that is why modern programming is so powerfull and versatile
Abdullahcpa is offline  
Unread 3rd Jul 2024, 10:35 AM   #4
New Warrior Member
 
Join Date: 2024
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default
RE: Is 'div' a Parameter or an Argument in JavaScript's document.createElement Method?
Share on: 
fb share twitter share gplus share more share

In JavaScript, `div` is an argument when passed to the `document.createElement` method.

Here's the breakdown:
- **Parameter**: This is a variable in the declaration of the function. In the case of `document.createElement`, the parameter is the element type to create.
- **Argument**: This is the actual value passed to the function when it is called. When you use `document.createElement('div')`, the string `'div'` is the argument.

Example:
```javascript
// Calling the method with 'div' as an argument
let myDiv = document.createElement('div');
```

In this case, `'div'` is the argument provided to the `document.createElement` method.
Meshii Mahi is offline  
The Following User Says Thank You to Meshii Mahi For This Useful Post:
Closed Thread


Bookmarks

Tags
argument, div, documentcreateelement, javascript, method, parameter

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 02:32 AM.