addCheckboxToSelectedArray = (item, hash) => {
return new Promise((res, rej) => {
try{
let checkboxes = this.state.selectedCheckboxes;
if(checkboxes.some(e => e.value === item)){
const findIndexOf = function(arr, val){
for(let i = 0; i < arr.length; i++) {
if(arr[i]['value'] === val){
checkForm = ({firstname, lastname, phone, email}) => {
const phoneRegex = /^\(?\d{3}\D*\d{3}\D*\d{4}$/;
const emailRegex=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
let emailInvalid = false;
let phoneInvalid = false;
if(!email.match(emailRegex) ){
emailInvalid = true;
}
let arr = [
{hash: "11223344", value: "abc"},
{hash: "11223344", value: "def"},
{hash: "22113344", value: "jkl"},
{hash: "22113344", value: "zyw"},
{hash: "33221144", value: "omn"},
{hash: "33221144", value: "xyz"}
];
let array = [
{hash: "11223344", value: "abc"},
{hash: "11223344", value: "def"},
{hash: "22113344", value: "jkl"},
{hash: "22113344", value: "zyw"},
{hash: "33221144", value: "omn"},
{hash: "33221144", value: "xyz"}
];
let array = [{
hash: "11223344",
value: "abc"
},
{
hash: "11223344",
value: "def"
},
{
let array = [{
hash: "11223344",
value: "abc"
},
{
hash: "11223344",
value: "def"
},
{
createApiCheckboxArray = (arr) => {
/**
* array.keys
*/
arr.map((item, i) => {
if(item.hashKey === i.hashKey){
let valArr = [];
valArr.concat(i.value);
Object.assign({item.hashKey}, valArr)
let flattenObject = function(ob) {
let toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
let flatObject = flattenObject(ob[i]);
for (let x in flatObject) {
var ob=[
{name:'john', surname:'miller', role:'teacher'},
{name:'jill',surname:'smith', role:'student'},
{name:'jeff', surname:'summers', role:'student'},
{name:'lisa',surname:'kenson', role:'teacher'}];
let input = 'teacher';
var res = ob.filter(o=>Object.values(o).includes(input));
import React from 'react';
import Transition from 'react-transition-group/Transition';
const duration = 300;
const defaultStyle = {
transition: `all ${duration}ms ease-in-out`,
opacity: 0,
top: 1000