Statr typing in the box for skill suggestions
I'm learning how to change the context of the function in Javascript from this slide. Here the example given is perfectly understandable:
var object = {};
function fn(){
return this;
}
console.log( fn() == this) //true
console.log( fn.call(object) == object); //true
But when I try this in Node JS, the result is somewhat different. First statement results in false and second equality is working as expected. So is there any difference in Global scope of Node JS and browser?
I know that browser has Global scope named window, but what about Node JS? What is the difference between those scopes which leads to above different behaviors?
I'm learning how to change the context of the function in Javascript from this slide. Here the example given is perfectly understandable:
/([+\/*-])\1/g
Characters that do need to be escaped in character classes are e.g. the escape character itself (backslash), the expression delimimiter (slash), the closing bracket and the range operator (dash/minus), the latter except at the end of the character class as in my code example.
You can use a backreference to a match in parentheses:
/(abc)\1
Here the \1 refers to the first parentheses (abc). The entire expression would match "abcabc".
To clarify again: We could use a quantifier on the backreference:
Define your pattern like this:
var patt1 = /\+\+|--|\/\/|\*\*/;
Now it should do what you want.
More info about regular expressions: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when