Skip to content

Instantly share code, notes, and snippets.

View karkranikhil's full-sized avatar
🎯
Focusing

nikhil karkra karkranikhil

🎯
Focusing
View GitHub Profile
const obj4 ={
firstName:'nikhil',
lastName:'karkra',
isTeaching: true,
address:{
state:'victoria',
city:'Melbourne'
}
}
const obj4 ={
firstName:'nikhil',
lastName:'karkra',
isTeaching: true,
greet:function(){
console.log("hi")
}
}
const obj5 = Object.assign({},obj4)
const obj4 ={
firstName:'nikhil',
lastName:'karkra',
isTeaching: true,
greet:function(){
console.log("hi")
}
}
const obj5 = obj4
const obj3 ={
firstName:'Nikhil',
lastName:'karkra',
isTeaching:true,
greet:function(){
console.log("hi")
}
}
---- adding keys Using dot operator ----
const obj2 ={}
obj2.firstName = 'nikhil',
obj2.lastName = 'karkra',
obj2.isTeaching = true,
obj2.greet = function(){
console.log("hi")
}
---- adding keys Using brackets ----
const obj2 ={}
handleComponentEvent:function (component, event, helper) {
var params = event.getParam('arguments');
console.log(params.param1)
if(params.param1 =='logoutComponent'){
alert('modal 1 submitted succesfully')
}
if(params.param1 == 'logoutComponent1'){
alert('modal 2 submitted succesfully')
}
<!-- required for Re-usable Modal -->
@karkranikhil
karkranikhil / style.js
Created December 26, 2018 23:32
Responsive Design using Style components
import styled from 'styled-components'
export const colors={
WHITE:'white',
GREEN:'#4CAF50',
BLUE:'#2196F3',
ORANGE:'#ff9800',
RED:'#f44336',
GREY:'#e7e7e7',
DARK_GREEN:'#46a049',
DARK_BLUE:'#0b7dda',
@karkranikhil
karkranikhil / vowelsAndConsonants.js
Created October 31, 2018 10:26
First, print each vowel in on a new line (in the same order as they appeared in ). Second, print each consonant (i.e., non-vowel) in on a new line (in the same order as they appeared in ).
function vowelsAndConsonants(s) {
var vowel =''
var consonant=''
for (let char of s){
if("aeiou".includes(char)){
vowel=vowel+char+"\n";
} else{
consonant=consonant+char+"\n";
}
}
<!DOCTYPE html>
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/94/three.min.js"></script>
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>
<a-scene embedded arjs="trackingMethod: best;">
<a-anchor hit-testing-enabled='true'>
<a-plane
src="http://hdwpro.com/wp-content/uploads/2016/06/HD-Free-Background.pngs"
height="1.5"
@karkranikhil
karkranikhil / App.js
Created March 26, 2018 10:20 — forked from lmiller1990/App.js
React Redux Async middleware example (use create-react-app)
import React, {Component} from 'react'
import {connect} from 'react-redux'
class App extends Component {
render() {
console.log(this.props)
return(
<div>
Ajax pending: {this.props.pending.toString()}
</div>