Skip to content

Instantly share code, notes, and snippets.

View karkranikhil's full-sized avatar
🎯
Focusing

nikhil karkra karkranikhil

🎯
Focusing
View GitHub Profile
#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
#----- Default source code encoding
sonar.sourceEncoding=UTF-8
#----- Default projectKey
addHighlightText:function(component, event, helper, str){
var className = "highlightText"
/*if(str){
var regex = str.split(' ');
regex = regex.filter(function(char){
return char !== '';
});
regex = regex.join('|');
regex = regex.replace(/[-[\]{}()*+?.,\\^$]/g, "\\$&");
var matcher = new RegExp(regex, 'gi');
import React, { Component } from 'react';
import * as ROUTES from '../../../constants/routes';
const INITIAL_STATE = {
height: '',
width: '',
depth: '',
noOfShelf:'',
contact:'',
function createArrFunction(){
const arr=[]
for(var i=0;i<5;i++){
arr.push(
(function(){
return function(){
console.log(i)
}
})(i))}
return arr
function createArrFunction(){
const arr=[]
for(let i=0;i<5;i++){
arr.push(function(){ console.log(i)})
}
return arr
}
const getArrFunction = createArrFunction()
getArrFunction[0]() // return 0
function createArrFunction(){
const arr=[]
for(var i=0;i<5;i++){
arr.push(function(){ console.log(i)})
}
return arr
}
const getArrFunction = createArrFunction()
getArrFunction[0]() // return 5
const obj4 ={
firstName:'nikhil',
lastName:'karkra',
isTeaching: true,
greet:function(){
console.log("hi")
},
address:{
city:'Melbourne'
}
------Nested level Object ---
const obj4 ={
firstName:'nikhil',
lastName:'karkra',
isTeaching: true,
greet:function(){
console.log("hi")
},
address:{
const obj4 ={
firstName:'nikhil',
lastName:'karkra',
isTeaching: true,
greet:function(){
console.log("hi")
}
}
function deepCopy(obj){
const keys = Object.keys(obj)
const newObject={}
for(let i=0;i<keys.length;i++){
const key = keys[i]
if((!!obj[key]) && (obj[key].constructor === Object)){
newObject[key] = deepCopy(obj[key])
} else {
newObject[key] = obj[key]
}