Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Shyam Ghanshyam-K-Dobariya

Block or report user

Report or block Ghanshyam-K-Dobariya

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
<script>
function isValidEmailId(emailId) {
var exp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
return exp.test(emailId)
}
View JS_Getters_Setters.md

Ever wondered why setting array.length = 0 makes an array empty or array.length = 'some string' throws exception ? Code example.

screen shot 2018-09-14 at 10 16 50 
am

So now you have curiosity to know what happens in the background when command array.length = 0 takes place ?

Let's start this journey with below requirement.

View Log_inside_life_cycle_method_of_a_user_defined_component.md

Create a higher order function that accepts a react component. Do logs when life cycle methods (componentWillReceiveProps or render) are called

F1.js

export function hocF (Component) {
  const cwp = Component.prototype.componentWillReceiveProps;
  Component.prototype.componentWillReceiveProps = function(...args) {
    console.log('in Component will receive props....')
    cwp.call(this, ...args)
  }
You can’t perform that action at this time.