usage of local variables when array value is constructed in relation to external conditions