मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)75k · #2943

modern-array-methods

यह क्या करती है

यह स्किल JavaScript कोड देखती है और जहाँ loops मंशा छिपाते हैं, वहाँ आधुनिक array और object methods सुझाती है। यह उन डेवलपर्स के लिए है जो छोटा और आसानी से समझ आने वाला कोड चाहते हैं।

कब इस्तेमाल करें

  • ✓जब आप एजेंट से JavaScript loops साफ़ करवाना या आधुनिक बनवाना चाहते हैं।
  • ✓जब किसी फ़ंक्शन में लंबे for या while loops हों जो डेटा filter, transform या search करते हैं।
  • ✓जब आप कोड की समीक्षा कर रहे हैं और ऑब्जेक्ट कॉपी या डेटा बदलने के सुरक्षित तरीके चाहते हैं।

Skill का लिंक

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/modern-array-methods/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/modern-array-methods/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप मेरी JavaScript फ़ाइल के loops आधुनिक array methods से दोबारा लिख सकते हैं, ताकि वे पढ़ने में आसान हों?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट ऐसे loops खोजता है जिन्हें map, filter, reduce, find या flatMap से बदला जा सके। वह उन्हें इस तरह लिखता है कि हर चरण का उद्देश्य method के नाम से ही साफ़ हो जाए।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Use modern array and object methods

Modern array and object methods produce code that directly expresses intent — a filter() call self-documents that you're selecting items. Manual for loops obscure the purpose behind implementation details. These methods are also well-optimized by JavaScript engines and support chaining for concise data transformations.

Quick Reference

  • Use map() to transform arrays, filter() to select items, reduce() for aggregation
  • Use find() and findIndex() instead of manual loops with break
  • Use Object.entries() and Object.fromEntries() to transform objects
  • Use structuredClone() for deep copying instead of JSON.parse(JSON.stringify())

Check

Find loops in this file that could be replaced with modern array methods like map, filter, reduce, find, or flatMap.

Fix

Replace manual for/while loops with appropriate array methods to make the code more declarative.

Explain

Explain map, filter, reduce, find, flatMap, and Object.entries with practical examples.

Code Review

Review scripts, client components, and browser execution paths related to Use modern array and object methods. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/javascript/modern-array-methods

अक्सर पूछे जाने वाले सवाल

loop की जगह filter क्यों इस्तेमाल करें?

filter कॉल एक नज़र में बताती है कि आइटम चुने जा रहे हैं, जबकि मैन्युअल loop यह विवरणों में छिपा देता है।

structuredClone किसलिए है?

स्किल इसे पुराने JSON.parse और JSON.stringify तरीके की जगह deep copy के लिए सुझाती है।

क्या इससे कोड का व्यवहार बदलेगा?

नतीजे वही रहने चाहिए, पर स्किल बदलाव को ब्राउज़र में जाँचने की सलाह देती है।

जानकारी

लेखक का मूल विवरण

Use when reviewing scripts, client components, bundles, or runtime behavior related to Use modern array and object methods. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.

repo: thedaviddias/Front-End-Checklist

लोकप्रियता

GitHub स्टार
75k
रैंकिंग में स्थान
#2943
लाइसेंस
MIT
अपडेट की गई
31/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills