Add preact in nextjs


  webpack: (config, { isServer }) => {
   // config.plugins.push(new webpack.EnvironmentPlugin(myEnv));

    if (!isServer) {
      Object.assign(config.resolve.alias, {
        react: 'preact/compat',
        'react-dom/test-utils': 'preact/test-utils',
        'react-dom': 'preact/compat',
      });
    }


    return config;
  }
  

Reverse String In Javascript

function check(val) {
  let re='';
  for(i of val) {
    re = i + re;
    console.log(re);
  }
 
}
check('nilesh');