Home > front end >  What is the meaning of the function name is equal to the true
What is the meaning of the function name is equal to the true

Time:12-04

CodePudding user response:

The body of the function defines a just and names of the variables with the same name

CodePudding user response:

What do you mean that this variable

CodePudding user response:

What do you mean that this variable

CodePudding user response:

Looked from the overall, what's the use of this variable

CodePudding user response:

For loop condition with the variable if the input string has a character (check out) for the first time is not in original string defined rules (indexof==1) the end of the cycle function returns false.
Otherwise it returns true (cycle will walk the)

CodePudding user response:

Is I don't understand is, function in var isValidString=true; And for loop isValidString==true on logic and represent what mean

CodePudding user response:

You should change this variable into any other name is also can be used, just exactly the same name, var===true is variable declarations XXX XXX is true judgment are equal

CodePudding user response:

refer to 6th floor weixin_45963892 response:
is I don't understand is, function in var isValidString=true; And for loop isValidString==true on logic and represent what we mean by


Var isValidString=true to isValidString assignment to true
IsValidString==true whether isValidString to true to true continues to cycle thermal cycle end

CodePudding user response:

First var isValidString=true, the function declarations of variables, the value of the function will return instructions string is effective, initialized to true said default is effective, the second for loop isValidString==true is in the judgment conditions, do not add this function is also right judgment conditions, added after can shorten the cycle, as long as the isValidString==false this is carried out, the next step of the loop condition is not established, jump out of the loop,

CodePudding user response:

Outside the equivalent definition of a state, it is the judgement conditions, meet the true state of the execution loop
  • Related