Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var valRule = {p1 : {
- "validation" : true,
- "id" : 'string',
- "name" : 'string',
- },
- p2 : {
- "validation" : true,
- "name" : 'string',
- "maxLength": 30
- },
- p3 : {
- "validation" : false,
- "name" : 'string',
- "type" : "template"
- }
- }
- var obj = {
- p1 : {
- "id" : '32324',
- "name" : 'page1',
- },
- p2 : {
- "name" : 'page2',
- "type": "template"
- },
- p3 : {
- "name" : 'page3',
- "type": "template2"
- }
- }
- for (var property in valRule){
- if(valRule[property].validation === true){
- console.log(valRule[property]);
- for (var [key, value] of Object.entries(valRule[property])){
- if(!valRule[property].name[property] === 'string'){
- console.log(value)
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment