What are the square brackets for? what does void mean? And please clear difference between console.writeline and console.write? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What are the square brackets for? what does void mean? And please clear difference between console.writeline and console.write?

23rd May 2017, 1:58 PM
Jai Garg
Jai Garg - avatar
4 Answers
0
[] usually containing an index for an array/object, with this index number you can access the particiular element in the array/onject void means nothing, none, empty, trash.... it just means there is no return value of a function/method. console.writeline will add an newline char to the end of the given string. So it will write a full valid line console.write will not...it just append the given string
23rd May 2017, 2:04 PM
nouseforname
nouseforname - avatar
0
I joined this today ...can u explain what does "no return value" mean? and what is array and accessing particular element?
23rd May 2017, 2:07 PM
Jai Garg
Jai Garg - avatar
0
well, just go ahead with the tutorial and you will learn. in short terms: functions / methods are used to call code that is used several times. those calls can give you an result of eg an calculation, or you just printed out something. For the print you can use void as return value but for the calculation you want to get the result Array is an variable type or container which can include more than only one value. Imagine it as a list of values. Each list position do have a index number. With this index number you can acces the item.
23rd May 2017, 2:12 PM
nouseforname
nouseforname - avatar
0
thankyou
23rd May 2017, 2:24 PM
Jai Garg
Jai Garg - avatar