I have an array in which I want to loop through each element and find it's value from the props which is passed to the component.
array = ['a','b','c']
I want to save the value of 'this.props.a' to a variable 'a; and similarly for other variables considering props does have the values saved , how can I do that ?
sample code :
buildURL() {
const param_array=array = ['a','b','c']
const param_values=[];
let queryStringUrl = window.location.href.split('?')[0];
param_array.map((param)=>{
param_values.push(encodeURIComponent(this.props.param))
})
Here I need this.props.search_item , this.props.search_type , this.props.article_quality and this.props.min_views .
How can I get that?