1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Degger [83]
3 years ago
14

Why do we use if statements in JavaScript?

Computers and Technology
1 answer:
alexdok [17]3 years ago
8 0

Answer:

The if statement is used to check a condition

You might be interested in
What are the process of boots up a computer?​
Sindrei [870]

Answer:

in computer booting is the process of starting a computer it can be initiated By hardware such as button press or by a software command after it is switched on a computer central processing unit ( CPU)

3 0
3 years ago
Write a function called getChar that has no function inputs, but takes in two character inputs from the user (in1 and in2) and o
bearhunter [10]

Answer:

def getChar():

   while True:

       in1 = input('Enter first char: ')

       try:

           if len(in1) != 1:

               raise

           else:

               in2 = input('Enter second char: ')

               if len(in2) != 1:

                   raise

               else:

                   break

       except:

           print('Enter just one character')

   return in1, in2

def chars2string(in1,in2):

   print(in1*5 + in2*5)

def main():

   ls = getChar()

   in1 = ls[0]

   in2 = ls[1]

   chars2string(in1, in2)

if __name__ == '__main__':

   main()

Explanation:

The programming language used is python 3.

The script first defines a function getChar and makes use of a while loop in combination with try and except blocks and IF statements, the code ensures that both inputs that are entered by the user after the prompt are 1 in length. i.e. Just one character. This function returns the two characters that were entered.

The second function that is defined is chars2string this function takes two arguments, It repeats each argument five times and returns a joined string.

Finally, the main function is defined and it calls the getChar function  first, the values that are returned by this function is assigned to two variables, that is then passed on to the chars2string function. The main function is called and the Joined string is printed to the screen.

3 0
4 years ago
At what x position are the ellipses drawn??? thanks ♡​
Anna71 [15]

Answer:

55

Explanation:

The xPos variable is set to 55 and they have set the variable in the code for the ellipses in the x position

Hope this helps

7 0
3 years ago
What is the best way to delete a program that you downloaded that says that its open but its not opened in your screen? I will g
NNADVOKAT [17]

Answer:

Ctrl+Alt+Del and open Task Manager. Right-click and select End Process. Proceed with uninstalling the program as normal, now that the program has been closed.

Explanation:

7 0
3 years ago
Read 2 more answers
Mention five internet services​
sergiy2304 [10]
<h3>1 ) cable internet </h3><h3>2) DSL internet </h3><h3>3) sattalite internet</h3><h3>4) mobile internet</h3><h3>5) BSNL </h3>

<h2>please mark me as brainlist</h2>

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a function called list_codons which takes a single argument called orf (expected to be a string representing an ORF sequen
    7·1 answer
  • Refer to the following statement: “We have implemented several IT solutions:
    14·1 answer
  • What is the value of alpha[3] after the following code executes?
    6·1 answer
  • What tab on the ribbon do I go into to create new database objects in Access?
    13·1 answer
  • Can anyone help me to write an example for html language​
    14·2 answers
  • how risk can impact each of the seven domains of a typical IT infrastructure: User, Workstation, Local Area Network (LAN), Local
    7·1 answer
  • Which types of file formats are the best choice for files that may need to be edited later?
    14·1 answer
  • What are the specifications of mine shaft head gear​
    11·2 answers
  • Can someone suggest how to manage a group when you are the group leader?​
    10·2 answers
  • Simple question: what is bandwidth?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!