Jump to content
Larry Ullman's Book Forums

raziqijr

Members
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About raziqijr

  • Rank
    Newbie
  1. another question is that what is the difference between property and variable , is not property aslo a variable ? can u pls define prototype chain and scope chain a bit more so that i can understand it easily
  2. when using functions inside functions the variable names are resolved from scope chain and when objects are inside another object then the property names are resolved through prototype chain , so prototype chain and scope chain are different because scope chain is used for functions and prototype chain is used for objects that why we should use keyword this inside function to refer to object the method is inside , am i correct here .
  3. thank you very much HarleySan. i ask these question to better understand the inner-workings of JS, is it good to understand the inner-working of JS or should we just follow what is written in books, does this effect our learning things
  4. i am thinking if function inside another function can access outer functions variable then why it cant access the obj object property name then.
  5. var obj { var name: 'some value', mtd: function () { alert(name); } } obj.mtd(); The mtd function defined in obj has no defined parameters, but when called the this reference and argument list are passed to the function. Is the name property of obj also present in the mtd function so it can be used in the alert() call as above, or does the mtd function have nothing to do with the property named name? if lerry ullman answer my question than it would be so great
  6. thanks again, i understand the use of this keyword , another confusion is say if we have an obj which has some method inside so now the method belong to object that mean we can change obj properties inside the function so why should we use this keyword
  7. if we have a function inside any object say var = obj { str: ‘hello’ , sayhello: function (){ alert (str); // without the “this” keyword } } console.log(obj.sayhello()); the variable str is alerted witch has the value "hello"
  8. yes its written in the book "$v was not found in $value" after all this is what i was talking about
  9. ok now read it carefully The foreach loop will access each item in the $very_bad array one at a time, assigning each item to $v. Within the loop, the stripos( ) function will check if the item is in the string provided to this function as $value. The stripos( ) function performs a caseinsensitive search (so it would match bcc:, Bcc:, bCC:, etc.). The function returns a Boolean TRUE if the needle is found in the haystack (e.g., looking for occurrences of $v in $value). The conditional therefore says that if that function’s results do not equal FALSE (i.e., $v was not found in $value), return an empty string. the bold red text above should really have said (i.e , $v was found in $value) not (i.e., $v was not found in $value) what do u say?
  10. thanks for your assistant , your right i understood your code but could you pls explain this for me foreach ($very_bad as $v) { if (stripos($value, $v) !== false) return ""; }
  11. look sir if stripos() functions result do not equal to false which mean ($v is found in $value) then return empty string. because if stripos() function result is false then it means ($v is not found in $value ) . i am confused pls give me a simple example
  12. this is the the page 405 chapter 13 The foreach loop will access each item in the $very_bad array one at a time, assigning each item to $v. Within the loop, the stripos( ) function will check if the item is in the string provided to this function as $value. The stripos( ) function performs a caseinsensitive search (so it would match bcc:, Bcc:, bCC:, etc.). The function returns a Boolean TRUE if the needle is found in the haystack (e.g., looking for occurrences of $v in $value). The conditional therefore says that if that function’s results do not equal FALSE (i.e., $v was not found in $value), return an empty string. in above page i bold the text which should really have said (i.e $v was found in $value) am i right pls correct me if i am wrong.
×
×
  • Create New...